guoyingtao / Mantis

An iOS Image cropping library, which mimics the Photo App written in Swift.
MIT License
926 stars 184 forks source link

Cropped image is sometimes a pixel off #259

Closed budidino closed 1 year ago

budidino commented 1 year ago

After cropping some images to a 1:1 square, I sometimes get results that are a bit off. Mantis version: 2.4.0

How to replicate

My settings

cropVC.config.presetFixedRatioType = .alwaysUsingOnePresetFixedRatio(ratio: 1/1)
cropVC.config.cropViewConfig.cropShapeType = .circle(maskOnly: true)

Example image 514 x 546

img

Size after cropping without zooming or panning: 514 x 513

Screenshot 2023-01-30 at 15 33 49


I've added some extra check and cropping functionality in my code to get around this issue, but it would be ideal if the result for 1:1 images was actually 1:1 😅

guoyingtao commented 1 year ago

@budidino Can you have a test using Mantis 2.5.2 which I just just released for fixing this issue? Thanks!

budidino commented 1 year ago

@guoyingtao I can confirm that it works 👍 🚀