-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIImage extension scaling change scale property of image to uiscreen default #277
Comments
… haven't that metadata)
Hi @neokree, thank you for filing this issue. I've just pushed change 61a029d into As a secondary addition, I've added the ability to customize the This change will be released as part of AFI 4.0.0 here shortly. Cheers. 🍻 |
Hi @cnoon , thank you for your work! |
Hello,
I have an image loaded from assets. This image have a
image.scale
property equal to1.0
.Now after I use
.af_imageScaled
or.af_imageAspectScaled
on that I see that property will change to2.0
, which I think is the same as issue #89.I tried to inspect your code, and I found that you call in either extensions this method:
UIGraphicsBeginImageContextWithOptions(size, af_isOpaque, 0.0)
where the third parameter is the scale and if is setted to 0.0 the device main screen scale is used (from Apple documentation here: https://developer.apple.com/documentation/uikit/1623912-uigraphicsbeginimagecontextwitho?language=objc).There would be useful if you let the developer set the UIImage scale value.
In my case, I don't need to use the image in a view but I'm scaling it for sending a thumbnail to a server and this method is doubling the image size only because my device screen have a scale of 2.0.
Please let me know if you would add a scale parameter on af_* extensions.
Thank you for your library and your time
The text was updated successfully, but these errors were encountered: