AcademySoftwareFoundation / openexr

The OpenEXR project provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the motion picture industry.
http://www.openexr.com/
BSD 3-Clause "New" or "Revised" License
1.63k stars 617 forks source link

Slow opening of exr image in GIMP #1887

Open haaninjo opened 6 days ago

haaninjo commented 6 days ago

Over in GIMP we got a report of .exr images being slow to load recently: https://gitlab.gnome.org/GNOME/gimp/-/issues/12169

Could reproduce this and see that it didn't happen when using an older version of openexr, so bisected this, and got this result:

7e0da7f5b79902e5a8e38f227d8e6f36cc3ef655 is the first bad commit
commit 7e0da7f5b79902e5a8e38f227d8e6f36cc3ef655 (HEAD)
Author: Kimball Thurston <kdt3rd@gmail.com>
Date:   Sun Apr 28 12:01:36 2024 +1200

    Convert scanline input file to use the core

    simplifies input file as well. Future changes may lift common code out
    of scanline input into common utility in context / somewhere.

Test case: Exported https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_21.nef to exr in Darktable, and opened the resulting image in GIMP. On earlier versions of openexr it took about 4 seconds, while it takes 50 seconds after commit 7e0da7f5b79902e5a8e38f227d8e6f36cc3ef655.

lgritz commented 6 days ago

What platform and what specific version of OpenEXR?

Is this by any chance addressed by #1868? Can you check the very latest to verify that it's still a problem?

haaninjo commented 6 days ago

My system is Debian Testing, original reporter was also on some Linux system.

Still slow opening when building OpenEXR from latest main commit https://github.com/AcademySoftwareFoundation/openexr/commit/bfbb0358731645c3a16529f7d1c53d54e4ddbba6

kthurston commented 4 days ago

This seems strange, when you exported from dark table, what settings did you use (I have a Nikon camera, so can likely use my own image to test with)? We have seen nothing like what is reported in terms of performance degradation, although also have not actively tested with gimp - I would suspect that we have unknowingly introduced a scenario where threading is not applied consistently during reading.

haaninjo commented 4 days ago

Used Darktable 4.8.1 on Debian Testing. I don't think I changed any settings from default, see image:

Darktable-formatoptions

I see now that Darktable shows a warning on exporting: [exr export] warning: exporting with anything but linear matrix profiles might lead to wrong results when opening the image

kmilos commented 3 days ago

I see now that Darktable shows a warning on exporting: [exr export] warning: exporting with anything but linear matrix profiles might lead to wrong results when opening the image

This is just about gamma tone curve (i.e. one should explicitly choose a "linear" color profile w/o a tone curve in the darktable export settings for EXRs because that is implicit for the format), and it shouldn't affect I/O...