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
iOS 17 ImageIO indexed color png decode problem #3648
Comments
You misunderstand that code. The endian is about It's not about the memory order to read bytes. Any real problem about this ? I don't understand why you only pick these line of code snippet. Like bug report ? For example, if you want to know the https://github.com/dreampiggy/iOS17IndexedPNGDecodeBug solution, check #3605 and use v5.18.5+ |
If you'd like, I can rename this local variable into |
I'm not saying there's a problem with the variable name, I'm saying that kCGBitmapByteOrderDefault is supposed to correspond to Little-endian in IOS, meaning that RGB is inverted. Your fetch should be inverted. So the byteOrderNormal variable should be set to NO for kCGBitmapByteOrderDefault. |
Do you, actually see, any I assume this is |
Just to clarify:
Is there any bug or runtime issue because of this line ? I want to knwo what's your actual propose (feature request or bug report) |
I run your demo and it returns kCGImageByteOrderDefault. |
So, you means when see And alphaInfo is I should assume the |
So your guess that It's should be |
Indeed, my guess is wrong. |
|
So kCGImageByteOrderDefault in IOS we can consider it big-endian right? |
Thank you for your answer |
This enum does never represent |
So what does it stand for? I was just trying to figure out what it meant by naming it byteOrderInfo. |
This only a hint because Apple, can not extend the They want to represent this. So a clever people introduce a new enum For example:
default order means I remember when I firstly see this enum, I read another image processing library and they alias to |
Just to be simple: CGBitmapInfo can represent kCVPixelFormatType CGBitmapInfo use |
You can also run SDWebImage's
Which test the |
That's awesome |
Actually, on Apple's platform (without the old history You just read the pixel in bytes in memory (using little-endian if you use It's about image processing I guess and Apple already provide many utils like |
When you see You always need to read first 8 bytes from right to left, then 8 bytes from right to left. No matter what And then, you need to translate the Assume you get When you see When you see When you see |
So this is why I say It's not about indian, it's about pixel order... It's not about How you read bytes, but actually How that represent the color pixel format |
Your answer is very good, I am a junior IOS developer from Beijing (just graduated 5 months ago), I want to learn SDWebImage, I hope to become a SDWebImage Maintainer in the future, I don't have any image rendering basics, do you have any learning suggestions? |
Misunderstand your question. The below it's SDWebImage's design, not Image Processing See this: Chinese version: |
For Image Processing, maybe my blog can help for you ? It's all about something on Apple's platform (not about DSP, but the API and knowledge before you write code) https://dreampiggy.com/tags/Image/ There are 3 blogs about Apple's ImageIO/vImage/libwebp And some other blogs about other thing like SF symbols, lottie... |
Thank you |
In kCGBitmapByteOrderDefault IOS is a Little-endian, why byteOrderNormal is it not set to NO?
The modified code is as follows
switch (byteOrderInfo) {
case kCGBitmapByteOrderDefault: {
byteOrderNormal = NO; //set to NO
} break;
case kCGBitmapByteOrder16Little:
case kCGBitmapByteOrder32Little: {
} break;
case kCGBitmapByteOrder16Big:
case kCGBitmapByteOrder32Big: {
byteOrderNormal = YES;
} break;
default: break;
}
The text was updated successfully, but these errors were encountered: