Cannot open very large JPEG
Describe the bug Nomacs refuses to open very large JPEG files.
To Reproduce Steps to reproduce the behavior:
- Download https://storage.noirlab.edu/media/archives/images/large/noirlab2430b.jpg (207 111 561 bytes, 40 000 x 20 000 pixels)
- Open this file with nomacs:
$ nomacs noirlab2430b.jpg
[INFO] Hi there
[INFO] Metadata support for BMFF formats is active.
[INFO] plugins dir set to: "/usr/lib64/nomacs-plugins"
[INFO] loaded app mode: 0
[INFO] [theme] default widget style/name: "QWindowsStyle" "windows"
[INFO] [theme] set color scheme hint: Qt::ColorScheme::Light => Qt::ColorScheme::Light
[INFO] [theme] current color scheme hint: Qt::ColorScheme::Light
[INFO] [theme] CSS loaded from: "/usr/share/nomacs/Image Lounge/themes/Light-Theme.css"
[INFO] [theme] CSS loaded from: ":/nomacs/stylesheet.css"
[INFO] theme applied in: 0 ms
[INFO] local client created in: 1 ms
[INFO] restore geometry: QRect(3072,36 306x446) windowState: QFlags<Qt::WindowState>(WindowMaximized)
[INFO] init window: appMode: 0 maximized: true fullscreen: false geometry: QRect(3072,36 306x446) windowState: QFlags<Qt::WindowState>(WindowMaximized)
[INFO] show window: appMode: 0 maximized: true fullscreen: false geometry: QRect(3072,36 306x446) windowState: QFlags<Qt::WindowState>(WindowMaximized)
[INFO] active window: appMode: 0 maximized: true fullscreen: false geometry: QRect(1920,32 1920x1016) windowState: QFlags<Qt::WindowState>(WindowMaximized)
[INFO] window font: QFont(Noto Sans,11,-1,5,400,0,0,0,0,0,0,0,0,0,0,1)
[INFO] system font: QFont(Noto Sans,14,-1,5,400,0,0,0,0,0,0,0,0,0,0,1)
[INFO] Initialization takes: 158 ms
[INFO] [DkImageLoader] 16 containers created in 0 ms
[INFO] [DkImageLoader] after sorting: 0 ms
[INFO] [DkImageLoader] 9055 containers created in 56 ms
[INFO] [DkImageLoader] after sorting: 162 ms
[WARNING] QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 2048 megabytes
[WARNING] [loadQt] "noirlab2430b.jpg" "Unable to read image data"
[WARNING] QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 2048 megabytes
[WARNING] [loadQt] "noirlab2430b.jpg" "Unable to read image data"
[WARNING] [Loader] noirlab2430b.jpg image/jpeg failed to load
Empty nomacs window opens.
Expected behavior Nomacs should display the image no worse than web browsers do.
Desktop (please complete the following information):
- OS: Gentoo Linux
- Version: nomacs 3.21.1, qtbase 6.8.3-r1
Additional context Similar to #1075, but this time 2048 megabytes is not enough.
You may try: export QT_IMAGEIO_MAXALLOC=4096 to bump the limit to 4GB. That might not work because there are also limits on dimensions.
You may try:
export QT_IMAGEIO_MAXALLOC=4096to bump the limit to 4GB. That might not work because there are also limits on dimensions.
Thanks, QT_IMAGEIO_MAXALLOC=4096 nomacs noirlab2430b.jpg works.
I am having the same issue on Windows. Is there a setting I can change to fix this?
I am having the same issue on Windows
You will need a .bat file that sets the environment variable as on Linux, changes directory to nomacs install directory, and then runs nomacs.
Changed to enhancement; we should add a user setting for this. It could be a slider in GB with a max value equal to the installed or free memory on the system.
This would be nice to have! Currently still having issues on the latest version with large jpgs not opening.