Hello,
Is it possible to disable core limits of ImageMagick so it will open 500 frames GIF of ~1900x1000 size, so it will use all available memory and fail only if memory is exhausted? Right now it correctly reads somewhere first 35 coalesced frames and no one operation can be done as pixel cache is exhausted. I'd prefer to allow Magick++ to use all available memory and throw exception if memory is out, so I can tell user that exactly this GIF is so big and can't be opened.
Thank you.
Large GIF with Magick++
-
- Posts: 3
- Joined: 2018-11-02T07:40:19-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Large GIF with Magick++
You can edit policy.xml. Is that what you mean?
snibgo's IM pages: im.snibgo.com
-
- Posts: 3
- Joined: 2018-11-02T07:40:19-07:00
- Authentication code: 1152
Re: Large GIF with Magick++
You want to say that:
uses policy.xml?
Can I somehow don't use any configuration files, just C++ code?
Code: Select all
Magick::InitializeMagick( nullptr );
std::vector< Magick::Image > frames;
Magick::readImages( &frames, fileName.toStdString() );
Magick::coalesceImages( &d->m_frames, frames.begin(), frames.end() );
Can I somehow don't use any configuration files, just C++ code?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Large GIF with Magick++
ImageMagick uses its configuration files. You can't turn that off. These set system-wide limits on memory usage etc. Limits can also work at the user level, or session level, or command level, but these can only be stricter. They cannot relax limits.
By default, IM will use all available memory for pixel caches. If that's not enough, it uses disk. policy.xml can set limits on memory and disk. I guess yours does. Editing that file will relax those limits.
By default, IM will use all available memory for pixel caches. If that's not enough, it uses disk. policy.xml can set limits on memory and disk. I guess yours does. Editing that file will relax those limits.
snibgo's IM pages: im.snibgo.com
-
- Posts: 3
- Joined: 2018-11-02T07:40:19-07:00
- Authentication code: 1152
Re: Large GIF with Magick++
Got it, thank you, I changed disk limit in policy.xml to 10 GiB and and now GIF opens.