https://bugs.kde.org/show_bug.cgi?id=507594
Bug ID: 507594
Summary: Fails to work on/save large, high resolution images
Classification: Applications
Product: Skanpage
Version First 25.04.3
Reported In:
Platform: NixOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
When scanning at a high resolution / large area—based on reading Qt
documentation, I believe the default threshold is the resulting image having
more than 500 million pixels, or about 22360x22360 (2000 megabytes at 32 bits
per pixel)—skanpage a) fails to show the image in the "Page n" view; b) fails
to save. The immediate symptom when scanning is this being printed 2-3 times on
stderr:
`qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current
allocation limit of 2000 megabytes`
Apparently this limit can be affected by two ways:
- The environment variable QT_IMAGEIO_MAXALLOC, which takes a limit in
megabytes (e.g. `QT_IMAGEIO_MAXALLOC=20000`)
- Calling the static method `QImageReader::setAllocationLimit(int)`.
I didn't try the first method yet, since I actually needed to be able to be
able to scan the same area I had selected, so I attached gdb to skanpage and
did `call QImageReader::setAllocationLimit(10000)`. I can confirm that this
fixes the problem for me, bumping the limit higher.
I would suggest that, since this limit is accessible to skanpage, it should
either adjust it (possibly asking if the user is sure), or at least fail to
even start a scan which will cause this issue.
STEPS TO REPRODUCE
1. Scan an image that has more than 500M pixels
2. Try to save the image
OBSERVED RESULT
1. The image is not shown (but skanpage does not crash)
2. Saving the image fails
EXPECTED RESULT
1. (Optionally) skanpage warns that the image will be large
2. Scanning and saving the image works just as with smaller images (assuming
enough RAM)
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS unstable, using sway as window manager
KDE Plasma Version:
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.§
--
You are receiving this mail because:
You are watching all bug changes.