You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thank you for this great library, I really appreciate its design.
I noticed that when I'm using a scaling method of AlamofireImage (e.g. af_imageAspectScaledToFillSize), I see its container (basic UIImageView) as red in the "color blended layers". But if I'm using my "own", then the color is green.
I'm putting below the code I used to create the image/imageView (nothing special):
I'm not sure if it's a big performance issue or not.
The resizing code I'm using is from this blog, which I converted to Swift.
1/ Do you want an Xcode project to reproduce the issue?
2/ Do you think it would be worth updating the scaling method? I could manage a pull-request if you want.
Notes: Xcode 7.2, iOS 9.2
Cheers,
Vincent
The text was updated successfully, but these errors were encountered:
I spent a bunch of time trying to figure out how to elegantly solve this problem. After several different approaches, I'm fairly happy with what I came up with. I added some alpha component inspection properties in 86602b2. Then I used those new properties to be smarter about specifying the opaque property in UIGraphicsBeginImageContextWithOptions in cd072e3.
What these changes will do is to automatically set the opaque flag to true when the image being resized is already opaque. In all the cases where transparent padding is used, we need to continue to set the opaque flag to false, otherwise that can result in undesired colored padding.
I also added some additional information to the public docstring of the af_imageAspectScaledToFitSize method to make it a bit easier to understand how the method behaves.
Hopefully these changes help make things easier for you.
Hi !
First, thank you for this great library, I really appreciate its design.
I noticed that when I'm using a scaling method of AlamofireImage (e.g.
af_imageAspectScaledToFillSize
), I see its container (basic UIImageView) as red in the "color blended layers". But if I'm using my "own", then the color is green.I'm putting below the code I used to create the image/imageView (nothing special):
I'm not sure if it's a big performance issue or not.
The resizing code I'm using is from this blog, which I converted to Swift.
1/ Do you want an Xcode project to reproduce the issue?
2/ Do you think it would be worth updating the scaling method? I could manage a pull-request if you want.
Notes: Xcode 7.2, iOS 9.2
Cheers,
Vincent
The text was updated successfully, but these errors were encountered: