EXIF metadata of specific JPEG file causes very slow loading
GIMP version: 2.8. I tried to install the Flatpak version of GIMP to see if the issue remains, but I haven't been able to start it yet (says it failed to load atk-bridge, and I didn't try a reboot yet).
Operating System: Linux 4.9.0-9-amd64, Debian 4.9.168-1+deb9u4 (2019-07-19)
Package: Linux Mint Debian's 2.8.18-1+deb9u1
One specific JPEG photo from a phone seemed impossible to open in GIMP, while photos taken just before and after worked fine. The file chooser did initially not generate any preview for this image and clicking to start loading it left GIMP working seemingly indefinitely without any error message or log to the command window. After the third cycle of killing and restarting GIMP, I left it running and after about five minutes it actually finished loading the problematic image. Thus it is not a full crash or failure but something is not working the way it should. Once GIMP managed to load the image, I resaved it and the new file loads quickly.
The original image loads normally in gthumb. Using imagemagick's convert to create a downsampled version, while preserving EXIF metadata gave the smaller but still problematic file that I attach here. Using jpg2png to convert the image to PNG format, which drops EXIF metadata, creates another version that works without problem in GIMP. Thus the problem seems to be something in the EXIF data of this specific image. I attach the downsized image that is still problematic, and another photo from the same device that works fine, both with EXIF metadata.
The bug is always reproduced (very long loading time, initially thought GIMP was frozen). I noticed that after having waited the long time without killing GIMP, a preview image is now available (quickly) within the file chooser dialog of GIMP, even if the loading still takes much time. I guess this is just a thumbnail cache, because it does not apply if I put a copy of my image in a different directory. The issue is also reproduced when GIMP is launched to specifically load this image (thus not using the file chooser or preview within GIMP). No progress bar or status text is indicating any kind of reading but the top command shows near 100% CPU usage by GIMP, until the image suddenly appears after some minutes.
Reproduction steps:
- Download the small version of the problematic image and one that works.
- Try to open either of them.
- Observe the difference in loading time.
Expected result: Both loading within a few seconds.
Actual result: The problematic image takes several minutes to load.