Image Import Issue - QImageIOHandler error

Hello, I’m attempting to import a background image (png, jpg etc) and getting the following error:

QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 256 megabytes

None of the images that I’m attempting to use are even close to 256 megabytes. I am running the latest version of Seamly2D.

3 curtidas

It’s not a question of what size the file is, but rather how large the file is uncompressed… i.e. the amount of needed memory allocated for the image.

" This error message, typically appearing as QImageIOHandler: Rejecting image as it exceeds the current allocation limit`, occurs when the Qt framework blocks an image from loading because its uncompressed size in memory would exceed a safety threshold.

In Qt 6, a security feature was introduced to prevent “pixel bomb” attacks (maliciously crafted small files that expand into massive amounts of RAM). By default, this limit is often set to 128 MB or 256 MB."

This limit is obviously something new with Qt6 after the Image import was implemented in the Qt5 releases. There are ways to fix the issue… such as setting environmental variables to increase the limit, but that’s rather a PITA. The other option is I could increases the limit in the code… QImageReader::setAllocationLimit(). If I did that I would probably create a new pref setting to select a few different limits like 128, 256, 384, 512.

That being said… I would try to load some files you know are small - like some icons, and if they don’t load then there is some other issue. Just for reference I just imported a full screen cap into Seamly no problem:

4 curtidas

I think that makes sense. I guess a few of the files I was trying to use were SVG files (actually layout exports from seamly) and maybe they were too large.

Several of the jpgs are working just fine though.

Hey @Douglas one other question, why when adding an image does it import it smaller than the image width (in inches)?

For instance, I have a jpg file that is actually 42 inches x 80 inches (for printing on a wide format printer). But when I add the image into seamly, it scales down to 31.5x60. So I have to scale it back up by 133.33% to get it back to the proper width.

2 curtidas

I’m not sure… If I think of it, I’ll take a look.

2 curtidas

No problem. It’s not a major issue anyway. Thanks for all for all of your help!

2 curtidas