roniemartinez / libqpsd

PSD (Photoshop Document) & PSB (Photoshop Big) Plugin for Qt/C++ (Qt4/Qt5)
GNU Lesser General Public License v2.1
108 stars 25 forks source link

problem with specific file #17

Closed coooooooorey closed 8 years ago

coooooooorey commented 8 years ago

When I load this file, app would crash.

https://drive.google.com/file/d/0BxUO3KDi7ZfydjBhYlJPTURDcjg/view?usp=sharing

How to avoid this?

roniemartinez commented 8 years ago

Hi,

The file is too big and takes a lot of memory. Even paint.net cannot load the image in a 4GB RAM system.

-Ron

coooooooorey commented 8 years ago

OIC Thx. :smile:

coooooooorey commented 8 years ago

Is there any way to avoid crash?

Something like throw a exception or return false?

roniemartinez commented 7 years ago

Hi, forgot to check my Github account due to long vacation.

Since there is only a limited number of exposed plugin API calls, this is not possible in the plugin point of view. You can (possibly) "pre-compute" how much space an image might take by getting the size from option and compare it to your available memory size. Then you can decide if you are still going to load the image or not.