mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 11:54:30 +01:00
Improve JPEG file detection (mainly for background image use)
This commit is contained in:
1 parent
b4efca9480
commit
60801e066f
2 files changed
+7
-4
No files matched your search
+4
-1
@@ -25,13 +25,16 @@ static Draw::DataFormat ZimToT3DFormat(int zim) {
|
||||
}
|
||||
|
||||
static ImageFileType DetectImageFileType(const uint8_t *data, size_t size) {
|
||||
if (size < 4) {
|
||||
return TYPE_UNKNOWN;
|
||||
}
|
||||
if (!memcmp(data, "ZIMG", 4)) {
|
||||
return ZIM;
|
||||
}
|
||||
else if (!memcmp(data, "\x89\x50\x4E\x47", 4)) {
|
||||
return PNG;
|
||||
}
|
||||
else if (!memcmp(data, "\xff\xd8\xff\xe0", 4)) {
|
||||
else if (!memcmp(data, "\xff\xd8\xff\xe0", 4) || !memcmp(data, "\xff\xd8\xff\xe1", 4)) {
|
||||
return JPEG;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in new issue
Block a user