JXR: Fix loss of HDR data on write for format RGBA16FPx16_Premultiplied

When writing RGBA16FPx16_Premultiplied format, the image was converted to RGBA64 by clamping the float values. With this patch float values ​​outside the range [0, 1] are preserved.
This commit is contained in:
Mirco Miranda 2024-12-23 06:36:39 +00:00
parent b649cca304
commit 1cb294545f
2 changed files with 6 additions and 1 deletions

View File

@ -457,7 +457,7 @@ public:
<< QImage::Format_Mono;
// clang-format on
// To avoid complex code, I will save only inetger formats.
// To avoid complex code, I will save only integer formats.
auto qi = source;
if (qi.format() == QImage::Format_MonoLSB) {
qi = qi.convertToFormat(QImage::Format_Mono);
@ -468,6 +468,11 @@ public:
else
qi = qi.convertToFormat(QImage::Format_RGBA8888);
}
#ifndef JXR_DENY_FLOAT_IMAGE
if (qi.format() == QImage::Format_RGBA16FPx4_Premultiplied) {
qi = qi.convertToFormat(QImage::Format_RGBA16FPx4);
}
#endif // JXR_DENY_FLOAT_IMAGE
// generic
if (!valid.contains(qi.format())) {