.png to .pdf conversion is failing with memory allocation error.
.png to .pdf conversion is failing with memory allocation error.
Hi Team,
When we try to convert a particular .png file of size 35MB is giving the below error:
convert.exe: memory allocation failed `001_25.png[0]' @ error/cache.c/AcquireCacheNexusPixels/4983.
Caught exception: Magick: Strip/tile too large for JPEG. `JPEGPreEncode' @ error
We are using the convert.exe command like this:
convert.exe 001_25.png -resize ! -density "200" result.pdf
ImageMagick version we are using : 7.0.8.12
Please find the input image file at the below path.
https://drive.google.com/file/d/12jsITN ... sp=sharing
Could you please let us know how can we resolve this issue?
Thanks,
Ambika
(case - 25048669)
When we try to convert a particular .png file of size 35MB is giving the below error:
convert.exe: memory allocation failed `001_25.png[0]' @ error/cache.c/AcquireCacheNexusPixels/4983.
Caught exception: Magick: Strip/tile too large for JPEG. `JPEGPreEncode' @ error
We are using the convert.exe command like this:
convert.exe 001_25.png -resize ! -density "200" result.pdf
ImageMagick version we are using : 7.0.8.12
Please find the input image file at the below path.
https://drive.google.com/file/d/12jsITN ... sp=sharing
Could you please let us know how can we resolve this issue?
Thanks,
Ambika
(case - 25048669)
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: .png to .pdf conversion is failing with memory allocation error.
Your "-resize !" is not documented syntax. What do you want IM to do with it?
For v7, I suggest you use "magick", not "convert" or "magick convert".
Your input is large, 315 M pixels.
For me, IM v7.0.7.-28 on a Windows 12 GB laptop, the command ...
... works fine, using a 2.5 GB temporary file for the pixel cache because I don't have enough free memory. But Adobe Acrobat Reader says:
You might try limiting memory usage so the pixel cache is forced to disk:
For v7, I suggest you use "magick", not "convert" or "magick convert".
Your input is large, 315 M pixels.
For me, IM v7.0.7.-28 on a Windows 12 GB laptop, the command ...
Code: Select all
magick 001_25.png -density 200 x.pdf
Check your temporary area (/tmp on Unix or %TEMP% on Windows) has enough free space.The dimensions of this page are out-of-range. Page content might be truncated.
You might try limiting memory usage so the pixel cache is forced to disk:
Code: Select all
magick 001_25.png -limit memory 10MB -limit map 10MB x.pdf
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: .png to .pdf conversion is failing with memory allocation error.
-resize needs a new size value. You cannot just use ! by itself. See https://imagemagick.org/script/command- ... p#geometry
Re: .png to .pdf conversion is failing with memory allocation error.
Hi,
We tried on the Windows 16 GB machine by freeing up the temporary area with the suggested commands:
1. magick 001_25.png -density 200 x.pdf
2. magick 001_25.png -limit memory 10MB -limit map 10MB x.pdf
There is 10 GB free memory but, still we get the same error(magick: memory allocation failed `001_25.png[0]' @ error/cache.c/AcquireCacheNexusPixels/4983).
Thanks,
Ambika
We tried on the Windows 16 GB machine by freeing up the temporary area with the suggested commands:
1. magick 001_25.png -density 200 x.pdf
2. magick 001_25.png -limit memory 10MB -limit map 10MB x.pdf
There is 10 GB free memory but, still we get the same error(magick: memory allocation failed `001_25.png[0]' @ error/cache.c/AcquireCacheNexusPixels/4983).
Thanks,
Ambika
Re: .png to .pdf conversion is failing with memory allocation error.
Hi,
Could you please help us to resolve this issue?
Thanks,
Ambika
Could you please help us to resolve this issue?
Thanks,
Ambika
Re: .png to .pdf conversion is failing with memory allocation error.
The conversion worked for us without complaint. We're using the latest ImageMagick release, 7.0.8-62. Download this release and let us know if the problem persists.
Re: .png to .pdf conversion is failing with memory allocation error.
Hi,
If I directly install the ImageMagick exe(ImageMagick-7.0.8-62-Q8-x86-dll.exe) and try the conversion it is working fine.
But, by following the steps mentioned here https://imagemagick.org/script/install- ... hp#windows to extract the binaries and then if we try the conversion using the generated exe, then the conversion is not working.
could you please help us to resolve this issue in this scenario?
thanks,
Ambika
If I directly install the ImageMagick exe(ImageMagick-7.0.8-62-Q8-x86-dll.exe) and try the conversion it is working fine.
But, by following the steps mentioned here https://imagemagick.org/script/install- ... hp#windows to extract the binaries and then if we try the conversion using the generated exe, then the conversion is not working.
could you please help us to resolve this issue in this scenario?
thanks,
Ambika
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: .png to .pdf conversion is failing with memory allocation error.
Have you checked the build with simpler commands like "magick rose: r.png"?RAmbika wrote:...then the conversion is not working.
What happens with your command? Any error messages? What is the text output if you insert "-verbose" as the first option?
snibgo's IM pages: im.snibgo.com
Re: .png to .pdf conversion is failing with memory allocation error.
Hi,
The command "magick rose: r.png" works fine with the build.
With command "magick 001_25.png -density 200 x.pdf" it is throwing the error "magick: memory allocation failed `001_25.png[0]' @ error/cache.c/AcquireCacheNexusPixels/4987)."
By inserting "-verbose" as first option in our command like "magick -verbose 001_25.png -density 200 x.pdf" we get the following:
001_25.png PNG 3392x93021 3392x93021+0+0 8-bit Gray 256c 35.3529MiB 33.166u 0:34.402
001_25.png=>x.pdf PNG 3392x93021 3392x93021+0+0 8-bit Grayscale Gray 256c 35.3529MiB 31.122u 0:31.155
magick: pixel cache allocation failed `001_25.png[0]' @ error/cache.c/AcquireCacheNexusPixels/4987.
Please have a look into this and let us know the way to get the successful conversion.
Thanks,
Ambika
The command "magick rose: r.png" works fine with the build.
With command "magick 001_25.png -density 200 x.pdf" it is throwing the error "magick: memory allocation failed `001_25.png[0]' @ error/cache.c/AcquireCacheNexusPixels/4987)."
By inserting "-verbose" as first option in our command like "magick -verbose 001_25.png -density 200 x.pdf" we get the following:
001_25.png PNG 3392x93021 3392x93021+0+0 8-bit Gray 256c 35.3529MiB 33.166u 0:34.402
001_25.png=>x.pdf PNG 3392x93021 3392x93021+0+0 8-bit Grayscale Gray 256c 35.3529MiB 31.122u 0:31.155
magick: pixel cache allocation failed `001_25.png[0]' @ error/cache.c/AcquireCacheNexusPixels/4987.
Please have a look into this and let us know the way to get the successful conversion.
Thanks,
Ambika
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: .png to .pdf conversion is failing with memory allocation error.
Sorry, I don't know what else to suggest.
snibgo's IM pages: im.snibgo.com
Re: .png to .pdf conversion is failing with memory allocation error.
Try this command:
Does that command work for you?
Code: Select all
magick -limit memory 1GiB -limit map 2GiB -define registry:temporary-path=./ 001_25.png -density 200 x.pdf
Re: .png to .pdf conversion is failing with memory allocation error.
Code: Select all
magick -limit memory 1GiB -limit map 2GiB -define registry:temporary-path=./ 001_25.png -density 200 x.pdf
It looks like regression issue. It worked for us with the 6.9.1-2 version of ImageMagick.
After upgrading to 7.0.7.21 and later this particular .png file works no more for us with 32-bit binaries.
Re: .png to .pdf conversion is failing with memory allocation error.
The command works flawlessly for us. We're using ImageMagick 7.0.8-64, the latest release under Linux. We'll try under Windows when we get a chance.
Re: .png to .pdf conversion is failing with memory allocation error.
Did you get a chance to check under windows environment?