mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00
[librptexture] Qoi: qoi.h has the R and B channels swapped compared to what rp_image expects.
This was broken since support for Qoi was added in v2.5. Not sure why I didn't notice it until now... Affects: v2.4 - v2.5
This commit is contained in:
parent
c3643b9244
commit
f0ee7bee10
2
NEWS.md
2
NEWS.md
@ -33,6 +33,8 @@
|
|||||||
empty data as a PNG image. (Needs more debugging for a proper fix...)
|
empty data as a PNG image. (Needs more debugging for a proper fix...)
|
||||||
* See #451: libpng errors crash due to libpng setjmp/longjmp (Windows 10, release builds only)
|
* See #451: libpng errors crash due to libpng setjmp/longjmp (Windows 10, release builds only)
|
||||||
* Reported by @Masamune3210.
|
* Reported by @Masamune3210.
|
||||||
|
* Qoi: R/B channels were incorrectly swapped when this was first added in v2.5.
|
||||||
|
* Affects: v2.5 - v2.5.1
|
||||||
|
|
||||||
* Other changes:
|
* Other changes:
|
||||||
* rpcli: Added more colorization for warning messages.
|
* rpcli: Added more colorization for warning messages.
|
||||||
|
@ -162,7 +162,14 @@ rp_image_const_ptr QoiPrivate::loadImage(void)
|
|||||||
px_src += src_stride;
|
px_src += src_stride;
|
||||||
}
|
}
|
||||||
free(pixels);
|
free(pixels);
|
||||||
|
|
||||||
|
// NOTE: qoi.h has the R and B channels swapped compared to what rp_image expects.
|
||||||
|
int ret = tmp_img->swizzle("bgra");
|
||||||
|
if (ret != 0) {
|
||||||
|
// Swizzle failed.
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
img.reset(tmp_img);
|
img.reset(tmp_img);
|
||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user