guoyingtao / Mantis

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

Wrong image size after cropping #267

Closed budidino closed 1 year ago

budidino commented 1 year ago

Version: 2.6.0

Setup

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

Issue

Selecting a screenshot image of size 1290 x 2796 with a crop ratio of 1:1 produces an image with the same resolution as the original, no matter which area or zoom I choose when cropping.

Screenshot 2023-02-01 at 21 40 05

guoyingtao commented 1 year ago

Hi @budidino Can you check if this issue is similar with #250?

guoyingtao commented 1 year ago

Does it happen to all images? Does it still work with 2.4.0 now?

budidino commented 1 year ago

Hi @budidino Can you check if this issue is similar with #250?

It could be related, but I don't know if that is an iOS version issue. It seems like a vertical image issue. I tested it using 2.4.0 and 2.6.0, and it is very easy to replicate on both... take a screenshot and use that photo for Mantis. It works ok with all my other images tested so far... mostly square or horizontal, but I wonder if that even matters.

budidino commented 1 year ago

Does it happen to all images?

No, so far only seems to affect screenshot (vertical) images... but I didn't test too much

Does it still work with 2.4.0 now?

Same issue on 2.4.0 and higher versions

guoyingtao commented 1 year ago

Would you mind posting one screenshot here so I can test with your screenshot? Thanks!

guoyingtao commented 1 year ago

Never mind. I reproduced it.

guoyingtao commented 1 year ago

@budidino I fixed this issue in this fix-bitmapInfo-error branch Can you have a test to see if it works for you? Thanks!

budidino commented 1 year ago

I'll test it first thing tomorrow ;)

budidino commented 1 year ago

Confirmed, it works 👍 🚀

guoyingtao commented 1 year ago

I released Mantis 2.6.1 which includes this fix. @budidino