Hello, everyone.
I found an issue of BMP encoder that looks like a bug.
When I try to save an image with 10000x10000 pixel dimension I catch an exception "Memory allocation failed" at bmp.c line 1715.
Why the BMP encoder tries to allocate so match memory at once ? How can I fix the issue?
I use Magick++, IM 6.9.0-7 for Win32.
BMP encoder
Re: BMP encoder
That is an implementation issue. This coder allocates the whole image instead of just a row. I will take a look if I can change this behavior.
EDIT:
You might also want to take a look at your limits. My machine can allocate the memory without any problems and could execute the following:
EDIT:
You might also want to take a look at your limits. My machine can allocate the memory without any problems and could execute the following:
Code: Select all
convert logo: -scale 10000x10000! d:\logo.bmp
-
- Posts: 58
- Joined: 2014-03-21T00:40:16-07:00
- Authentication code: 6789
- Location: Russia, Saint Petersburg
- Contact:
Re: BMP encoder
Hi.
It works fine in case of an application process only save an image. But if the application heap is partially used (about 30% for 32-bit application) for other reasons memory allocation can "randomly" fails. I guess It is not good idea to allocate so big memory block at once. May be it would be an option for the encoder.
It works fine in case of an application process only save an image. But if the application heap is partially used (about 30% for 32-bit application) for other reasons memory allocation can "randomly" fails. I guess It is not good idea to allocate so big memory block at once. May be it would be an option for the encoder.
Re: BMP encoder
I agree with you, but that would mean a rewrite of the bmp coder. I will put this on my todo list
Re: BMP encoder
Set your area resource limit to 0. From the command-line its -limit area 0. That should force the pixels to disk rather than memory and allow your command to complete.
-
- Posts: 58
- Joined: 2014-03-21T00:40:16-07:00
- Authentication code: 6789
- Location: Russia, Saint Petersburg
- Contact:
Re: BMP encoder
It does not help in my case.
Re: BMP encoder
Unfortunately we do not have access to a Win32 host. We did try Win64 and this command worked without complaint:
- convert logo: -scale 10000x10000! logo.bmp
-
- Posts: 58
- Joined: 2014-03-21T00:40:16-07:00
- Authentication code: 6789
- Location: Russia, Saint Petersburg
- Contact:
Re: BMP encoder
Physical memory is not a restriction for the 64-bit adress space in general.