Bug 420173 - thumbnail.so eats tons of memory with large GeoTiff
Summary: thumbnail.so eats tons of memory with large GeoTiff
Status: REPORTED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: Thumbnails and previews (other bugs)
Version First Reported In: 19.12
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-17 01:27 UTC by Sandro Mani
Modified: 2023-04-01 08:23 UTC (History)
2 users (show)

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


Attachments
Patch (589 bytes, patch)
2020-04-17 01:27 UTC, Sandro Mani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sandro Mani 2020-04-17 01:27:48 UTC
Created attachment 127598 [details]
Patch

SUMMARY
Put any huge image in a folder (im my case a 111320 x 66792 GeoTiff), launch dolphin and browse to that folder or its parent, and watch thumbnail.so eat up memory.

The cause is that QImageReader in ImageCreator::create (imagecreator.cpp) will read the entire raw image, in this needing I suppose like 27GB of memory.

The easiest remedy would be to just limit the size of the images ImageCreator::create will actually process, like to max 10240 in either dimension. Proposed trivial patch attached.

Note: QImageReader::setScaledSize reportedly works for some formats to directly read a downscaled image, but it does not seem to be the case with the qtiff driver.


SOFTWARE/OS VERSIONS
kio-extras-19.12.3
Fedora Rawhide
Qt 5.14.2
Comment 1 Marc Deop 2023-03-21 13:12:20 UTC
I believe the code has now some protection against this issue.

Perhaps this can be closed?
Comment 2 Mirco Miranda 2023-04-01 08:23:12 UTC
(In reply to Marc Deop from comment #1)
> I believe the code has now some protection against this issue.
> 
> Perhaps this can be closed?

Yes, it was patched with MR !219 (https://invent.kde.org/network/kio-extras/-/merge_requests/219)