Page 1 of 1

convert: Memory allocation failed

Posted: 2008-05-07T01:21:10-07:00
by 5f4gAeul
I need to convert a bmp-file (1,97 Gb (2 120 108 598 byte) to tiff format: "C:\>convert -monitor dm19.bmp -define tiff:rows-per-strip=1 -depth 8 -type Palette -compress RLE dm19.tif". But my result is:
convert: Memory allocation failed `dm19.bmp'.
convert: missing an image filename `dm19.tif'.


What should I do?

Re: convert: Memory allocation failed

Posted: 2008-05-07T05:55:00-07:00
by magick
Add -limit memory 1mb -limit map 1mb to your command line. If that fails, post a URL to your image so we can download and attempt to reproduce the problem.

Re: magick

Posted: 2008-05-07T23:21:19-07:00
by 5f4gAeul
Fails:
C:\Downloads>convert -monitor dm19.bmp -limit memory 1mb -limit map 1mb -define tiff:rows-per-strip=1 -depth 8 -type Palette -compress RLE dm19.tif
convert: Memory allocation failed `dm19.bmp'.
convert: missing an image filename `dm19.tif'.

I'll post an URL to my image soon.

Re: magick

Posted: 2008-05-12T00:17:44-07:00
by 5f4gAeul
Hi! I've uploaded the tiff-file: dm19.rar You should click green button «Скачать» but before type digits shown above it. After downloading you nedd to unrar the file.

Re: convert: Memory allocation failed

Posted: 2008-05-12T09:43:08-07:00
by magick
The problem is that the majority of the ImageMagick coders (e.g. pnm, tiff, miff, etc) allocate one or two scanlines in memory, however, the BMP coders tries to allocate the entire image. We will need to improve the algorithm to only read a scanline at a time so that large BMP image files can be processed. We did try your image on a Linux server with plenty-o-memory and it converted successfully.

Re: convert: Memory allocation failed

Posted: 2008-05-13T05:33:41-07:00
by 5f4gAeul
Unfortunately I don't have Linux server with plenty-o-memory. Will it work on PowerPC MacBook Pro with 2 Gb RAM? When will you improve the algorithm to only read a scanline at a time so that large BMP image files can be processed?

Re: convert: Memory allocation failed

Posted: 2008-05-13T06:40:52-07:00
by magick
It may be sometime before we refactor the BMP coder. In the mean time if you have to convert a few images as a one time thing we can do that for you. If you have to do this often you may want to use some other program other than ImageMagick.

Re: magick

Posted: 2008-05-14T06:25:27-07:00
by 5f4gAeul
to convert a few images as a one time thing we can do that for you
Thank you but it is not convinient for me. Could you please say about the size limit of bmp-files and tiff-files? If i try to reduce bmp-file size and increase their quantity will I be able to merge them (after converting) together as a tiff? I suppose that target file will be about 15 Gb. Could you please check my convert command for tiff as follows:

256 colors
Strips, with 1 scanline per strip
Packbits compression

Is "Convert -monitor dm19.bmp -define tiff:rows-per-strip=1 -depth 8 -type Palette -compress RLE dm19.tif" OK?