convert: Memory allocation failed

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".

convert: Memory allocation failed

Postby 5f4gAeul » 2008-05-07T01:21:10+00:00

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?
5f4gAeul
 

Re: convert: Memory allocation failed

Postby magick » 2008-05-07T05:55:00+00:00

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.
User avatar
magick
Site Admin
 
Posts: 9547
Joined: 2003-05-31T11:32:55+00:00

Re: magick

Postby 5f4gAeul » 2008-05-07T23:21:19+00:00

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.
5f4gAeul
 

Re: magick

Postby 5f4gAeul » 2008-05-12T00:17:44+00:00

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.
5f4gAeul
 

Re: convert: Memory allocation failed

Postby magick » 2008-05-12T09:43:08+00:00

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.
User avatar
magick
Site Admin
 
Posts: 9547
Joined: 2003-05-31T11:32:55+00:00

Re: convert: Memory allocation failed

Postby 5f4gAeul » 2008-05-13T05:33:41+00:00

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?
5f4gAeul
 

Re: convert: Memory allocation failed

Postby magick » 2008-05-13T06:40:52+00:00

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.
User avatar
magick
Site Admin
 
Posts: 9547
Joined: 2003-05-31T11:32:55+00:00

Re: magick

Postby 5f4gAeul » 2008-05-14T06:25:27+00:00

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?
5f4gAeul
 


Return to Users

Who is online

Users browsing this forum: Bing [Bot], fmw42, Google [Bot], Google Adsense [Bot] and 19 guests