Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 6.2 QImage JPG over 33,547,526 pixels no longer loads
Forum Updated to NodeBB v4.3 + New Features

Qt 6.2 QImage JPG over 33,547,526 pixels no longer loads

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rory_1
    wrote on last edited by
    #1

    My image viewer program, updated from Qt 5.15.2 to Qt 6.2, no longer will display jpg files over 33.5 million pixels. I also tried the Qt example application "imageviewer", which has the same issue. Qt has a web page https://doc.qt.io/qt-6/qtimageformats-changes-qt6.html suggesting something has changed, but all the page has is "ADD STUFF HERE".

    I determined it is a size issue by resizing an image down until it would work.

    The point of failure is QImage::load function. QImage::loadFromData also fails.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you provide a minimal compilable example along with such a file to show the issue ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Can you provide a minimal compilable example along with such a file to show the issue ?

        R Offline
        R Offline
        Rory_1
        wrote on last edited by
        #3

        @SGaist said in Qt 6.2 QImage JPG over 33,547,526 pixels no longer loads:

        Hi,

        Can you provide a minimal compilable example along with such a file to show the issue ?

        The imageviewer Qt example application. Any jpg greater than 33.6 million pixels.

        Example jpg that does not work (8640x5760 pixels): https://drive.google.com/file/d/1ZwWEJCVP7Mdqtt_SWbEPHVm1a6HBnkri/view?usp=sharing

        The same image, reduced in size to 7094x4729 pixels works: https://drive.google.com/file/d/1Jkpb2y527m066tGy1Y4O66Mcw8nhZ31Q/view?usp=sharing

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Which OS are you on ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Rory_1
            wrote on last edited by
            #5

            Both win10 and macos Big Sur 11.5.1.

            1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #6

              Hi, don't know if it's relevant but 2**25 = 33554432 which seems pretty close to 33,547,526.

              R 1 Reply Last reply
              0
              • hskoglundH hskoglund

                Hi, don't know if it's relevant but 2**25 = 33554432 which seems pretty close to 33,547,526.

                R Offline
                R Offline
                Rory_1
                wrote on last edited by Rory_1
                #7

                @hskoglund That was what I was thinking. The 33,547,526 number I gave is an estimate.

                1 Reply Last reply
                0
                • Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  See QImage::setAllocationLimit() and the warning output on your command line when you start your program:

                  qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 128 megabytes
                  

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  R 1 Reply Last reply
                  2
                  • hskoglundH Offline
                    hskoglundH Offline
                    hskoglund
                    wrote on last edited by
                    #9

                    Also, as an alternative to calling QImage::setAllocationLimit() you can set an environment variable QT_IMAGEIO_MAXALLOC to some bigger value of megabytes than the default 128 :-)

                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Christian Ehrlicher

                      See QImage::setAllocationLimit() and the warning output on your command line when you start your program:

                      qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 128 megabytes
                      
                      R Offline
                      R Offline
                      Rory_1
                      wrote on last edited by
                      #10

                      @Christian-Ehrlicher @hskoglund @SGaist Thanks very much gentlemen!

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved