WritePDFImage: Assertion `image->exception.reason failed.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
dlrdlrdlr
Posts: 4
Joined: 2015-08-25T13:12:45-07:00
Authentication code: 1151

WritePDFImage: Assertion `image->exception.reason failed.

Post by dlrdlrdlr »

I'm attempting to create a pdf of a folder full of .jpg files labeled as 001.jpg to 293.jpg
I'm on Archlinux with imagemagick 6.8.2.0-1 the command I run is
convert -monitor -limit memory 1 -limit map 1 *.jpg Handbook.pdf
I've opened 227.jpg and there doesn't seem to be any issues with it.
This is the last section of the terminal before failure. The rest above this is just more load image [xxx.jpg]

Code: Select all

load image[221.jpg]: 1267 of 1268, 100% complete
load image[222.jpg]: 1283 of 1284, 100% complete
load image[223.jpg]: 1256 of 1257, 100% complete
load image[224.jpg]: 1254 of 1255, 100% complete
load image[225.jpg]: 1268 of 1269, 100% complete
load image[226.jpg]: 1278 of 1279, 100% complete
mogrify image[227.jpg]: 226 of 227, 100% complete
convert: coders/pdf.c:1814: WritePDFImage: Assertion `image->exception.reason != (const char *) ((void *)0)' failed.
Aborted (core dumped)
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: WritePDFImage: Assertion `image->exception.reason failed.

Post by dlemstra »

Can you upgrade to the latest version and try this again?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
dlrdlrdlr
Posts: 4
Joined: 2015-08-25T13:12:45-07:00
Authentication code: 1151

Re: WritePDFImage: Assertion `image->exception.reason failed.

Post by dlrdlrdlr »

Sorry I think that was a typo though I reinstalled from pacman and it says 6.9.2.0-1. Tried again just in case and same issue.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: WritePDFImage: Assertion `image->exception.reason failed.

Post by magick »

ImageMagick should exit gracefully and we'll have a patch for that. In the mean-time, try
  • convert -define registry:temporary-path=/data/tmp monitor -limit memory 1 -limit map 1 *.jpg Handbook.pdf
where /data/tmp is a place on your system that has multi-gigabytes of free space. Does that help?
dlrdlrdlr
Posts: 4
Joined: 2015-08-25T13:12:45-07:00
Authentication code: 1151

Re: WritePDFImage: Assertion `image->exception.reason failed.

Post by dlrdlrdlr »

No tried on two external drives with about 1Tb each and my home drive with 14Gb and same error on the same picture. with this command

convert --define registry:temporary-path=~/ -monitor -limit memory 1 -limit map 1 *.jpg Handbook.pdf

Also if I remove the -limit memory and map it quits with Killed at image 267. If that's relevant
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: WritePDFImage: Assertion `image->exception.reason failed.

Post by fmw42 »

Should that not be -define and not --define (one dash)?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: WritePDFImage: Assertion `image->exception.reason failed.

Post by magick »

Its likely the program is running out of memory. Although limits are placed on memory, it only affects the pixel cache. ImageMagick must still allocate memory for the image metadata. Try this:
  • convert -define registry:temporary-path=~/ -monitor -limit memory 1 -limit map 1 *.jpg -compress zip Handbook.pdf
Does that make a difference? If not, can you try on another host with more memory? If that succeeds, we know lack of memory if the problem.

You can also try downloading the latest Beta. Hopefully our patch will allow 'convert' to display the reason for the exception.
dlrdlrdlr
Posts: 4
Joined: 2015-08-25T13:12:45-07:00
Authentication code: 1151

Re: WritePDFImage: Assertion `image->exception.reason failed.

Post by dlrdlrdlr »

Seems to have worked with that command. Took a lot longer but I have the pdf. I'm surprised memory was an issue. I have 8gb total and 3.1gb available using free -m

Thank you your assistance.
Post Reply