Windows icon indicating copy to clipboard operation
Windows copied to clipboard

About the issue of ImageCropper missing a pixel from a cropped image

Open GreenShadeZhang opened this issue 8 months ago • 0 comments

Describe the bug

When I used ImageCropper to cut the image,

the computer resolution was about 2K, and the image size was 128x296.

If I select the button method to reduce the area and then select all the pictures for cutting and saving,

there will be a loss of one pixel,

the size of the picture will become 127x295,

this time it will affect the image when I convert the picture to a fixed resolution,

and then affect the display,

I have seen the source code, the source code part will lose some data when there is a rounding,

so I want you to see if there is any solution to solve this problem.

Image

The compressed package is a test image. test_image.zip

Steps to reproduce

When I used ImageCropper to cut the image,

the computer resolution was about 2K, and the image size was 128x296.

If I select the button method to reduce the area and then select all the pictures for cutting and saving, 

there will be a loss of one pixel, 

the size of the picture will become 127x295,

this time it will affect the image when I convert the picture to a fixed resolution, 

and then affect the display.

Expected behavior

I want to cut the image if the length and width of the picture is 128:296, if I choose the original image size, please do not remove one pixel, this will affect the display of the image.

The picture below shows the picture of my device

Image

Screenshots

The picture below shows the operation diagram of cutting Image

The image below is a screenshot of the saved resolution after the cut

Image

Code Platform

  • [ ] UWP
  • [x] WinAppSDK / WinUI 3
  • [ ] Web Assembly (WASM)
  • [ ] Android
  • [ ] iOS
  • [ ] MacOS
  • [ ] Linux / GTK

Windows Build Number

  • [ ] Windows 10 1809 (Build 17763)
  • [ ] Windows 10 1903 (Build 18362)
  • [ ] Windows 10 1909 (Build 18363)
  • [ ] Windows 10 2004 (Build 19041)
  • [ ] Windows 10 20H2 (Build 19042)
  • [ ] Windows 10 21H1 (Build 19043)
  • [ ] Windows 10 21H2 (Build 19044)
  • [ ] Windows 10 22H2 (Build 19045)
  • [ ] Windows 11 21H2 (Build 22000)
  • [ ] Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • [ ] Windows 10, version 1809 (Build 17763)
  • [ ] Windows 10, version 1903 (Build 18362)
  • [ ] Windows 10, version 1909 (Build 18363)
  • [ ] Windows 10, version 2004 (Build 19041)
  • [ ] Windows 10, version 2104 (Build 20348)
  • [ ] Windows 11, version 22H2 (Build 22000)
  • [ ] Other (specify)

Other SDK version

No response

Visual Studio Version

No response

Visual Studio Build Number

No response

Device form factor

No response

Additional context

No response

Help us help you

Yes, but only if others can assist.

GreenShadeZhang avatar Apr 22 '25 08:04 GreenShadeZhang