This new algorithm fixed image rotation when loading from URL#455
Conversation
|
Hi Suzuki, |
|
Hi @longdaohu, thanks for creating the pull request! I will try the PR branch within this week. Thanks for contributing! |
|
Hi @tommyming, thanks for your quick response and willingness to test the changes! I’m glad to hear you’ll review it this week. If you have any questions or need further adjustments, feel free to let me know. I’m happy to help. Looking forward to your feedback! 😊 |
|
@longdaohu sorry for the late, just finished checking and will merge it now! |
This pull request adds a safeguard for handling single-frame images that are processed through the GIF animation path. Currently, when non-GIF images or single-frame GIFs are processed with the animated GIF methods, they can display with incorrect orientation.
The fix creates a specialized helper function that checks the frame count from the CGImageSource. When there's only one frame or fewer, it bypasses the animation logic and handles the image as a standard UIImage, preserving the correct orientation metadata. This maintains backward compatibility while fixing orientation issues for single-frame images.
Tests show this resolves the rotation problems without affecting multi-frame GIF rendering."
Does this capture the essence of your change? Would you like me to adjust the explanation to better fit the specific third-party library's contribution guidelines。
This link is the URL of an image: https://u.maigeai.com/album/2025/3/28/92ac1027.jpg. The preview shows an image with swapped widths and heights, after the fix it doesn't swap.