nomacs icon indicating copy to clipboard operation
nomacs copied to clipboard

Cannot open very large JPEG

Open tkzv opened this issue 5 months ago • 5 comments

Describe the bug Nomacs refuses to open very large JPEG files.

To Reproduce Steps to reproduce the behavior:

  1. Download https://storage.noirlab.edu/media/archives/images/large/noirlab2430b.jpg (207 111 561 bytes, 40 000 x 20 000 pixels)
  2. 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.

tkzv avatar Aug 03 '25 12:08 tkzv

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.

scrubbbbs avatar Aug 03 '25 12:08 scrubbbbs

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.

Thanks, QT_IMAGEIO_MAXALLOC=4096 nomacs noirlab2430b.jpg works.

tkzv avatar Aug 11 '25 23:08 tkzv

I am having the same issue on Windows. Is there a setting I can change to fix this?

ajchow66 avatar Oct 08 '25 05:10 ajchow66

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.

scrubbbbs avatar Oct 08 '25 11:10 scrubbbbs

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.

scrubbbbs avatar Oct 08 '25 11:10 scrubbbbs

This would be nice to have! Currently still having issues on the latest version with large jpgs not opening.

AmandaRoseChaqueta avatar Dec 14 '25 17:12 AmandaRoseChaqueta