CommunityToolkit / CommunityToolkit/Windows
About the issue of ImageCropper missing a pixel from a cropped image
- Lingua principale
- C#
- Stelle
- 1.1k
- Fork
- 166
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
### 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.

The compressed package is a test image.
[test_image.zip](https://github.com/user-attachments/files/19846559/test_image.zip)
### Steps to reproduce
```text
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

### Screenshots
The picture below shows the operation diagram of cutting

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

### 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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
L’issue riguarda ImageCropper nel percorso WinAppSDK/WinUI 3; inizia riproducendo il ritaglio 128x296 con l’immagine di test fornita e ispeziona il percorso del codice sorgente che esegue l’arrotondamento. Il lavoro è completato quando la selezione delle dimensioni dell’immagine originale conserva le dimensioni complete di 128x296 senza perdere nemmeno un pixel.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- desktop
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100