Bug 433877 - The Radiance/RGBE/.hdr QImageIOHandler plugin is broken. Non-square images fail to load.
Summary: The Radiance/RGBE/.hdr QImageIOHandler plugin is broken. Non-square images fa...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.79.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-02 21:24 UTC by Fonkle
Modified: 2021-03-04 21:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fonkle 2021-03-02 21:24:02 UTC
SUMMARY

The Radiance/RGBE/.hdr QImageIOPlugin is broken. Non-square images (width != height) fail to load.

STEPS TO REPRODUCE
1. Open Dolphin
2. Set 'View Mode' to 'Icons'
3. Navigate to a location containing non-square Radiance/RGBE/.hdr images

OBSERVED RESULT

No thumbnails are generated for non-square Radiance/RGBE/.hdr images.

EXPECTED RESULT

Thumbnails should be generated for all Radiance/RGBE/.hdr files including non-square ones.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Kubuntu 20.10 / KDE Neon
(available in About System)
KDE Plasma Version: 5.19.5 / 5.21.1
KDE Frameworks Version: 5.74.0 / 5.79.0
Qt Version: 5.14.2 / 5.15.2

ADDITIONAL INFORMATION

The Radiance/RGBE/.hdr loader erroneously switches width and height in the -hardcoded- supported image orientation resulting in non-square images failing to load. It is related to bug 426689 however the problem is in frameworks-kimageformats instead of kio-extras.
Comment 1 Fonkle 2021-03-02 21:46:17 UTC
QImageIOPlugin = QImageIOHandler plugin.
Comment 2 Albert Astals Cid 2021-03-04 21:59:32 UTC
Git commit 503b3eee2b3ed599310e1e6e41e74398f53a6303 by Albert Astals Cid, on behalf of Fred Fonkle.
Committed on 04/03/2021 at 21:57.
Pushed by aacid into branch 'master'.

Fix Non-square Radiance/RGBE/.hdr images failing to load

The HDR QImageIOHandler plugin only supports the default image orientation (-Y +X) in .hdr files. It mixes up the width and height however, resulting in non-square images not loading.

This fix adds a check for the standard image orientation in the file and returns false (with error message) if that fails.
If it succeeds, it takes the height from the -Y component, and the width from the +X component, resulting in successful loading of the image.

Add autotest images for landscape and portrait HDR (Radiance RGBE) loader

A  +-    --    autotests/read/hdr/rgb-landscape.hdr
A  +-    --    autotests/read/hdr/rgb-landscape.png
A  +-    --    autotests/read/hdr/rgb-portrait.hdr
A  +-    --    autotests/read/hdr/rgb-portrait.png
M  +9    -2    src/imageformats/hdr.cpp

https://invent.kde.org/frameworks/kimageformats/commit/503b3eee2b3ed599310e1e6e41e74398f53a6303