Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124510

It is not possible to determine if QImageReader failed to load an image due to allocation limit

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.7
    • Image formats
    • None
    • All

    Description

      When using `QImageReader` to read image files, if the resulting image is larger than the set (or default) allocation limit, the read fails. The terminal output does show that the reading has failed due to the allocation limit ("qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of XX megabytes") but the caller only gets the error enum value `QImageReader::InvalidDataError` - which could be any number of things (AFAIU) including corrupted image data.

      For applications that want to implement functionality similar to GIMP, where loading an image that is "too big" causes a message dialog asking for permission to increase the limit (instead of just failing), it would be very useful if there was a specific `QImageReader::ImageReaderError` enum value for the allocation limit error.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            guss77 Oded Arbel
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes