Page 1 of 1

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

Posted: 2015-08-25T13:18:21-07:00
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)

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

Posted: 2015-08-25T13:27:16-07:00
by dlemstra
Can you upgrade to the latest version and try this again?

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

Posted: 2015-08-25T17:40:37-07:00
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.

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

Posted: 2015-08-26T08:12:32-07:00
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?

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

Posted: 2015-08-26T08:31:50-07:00
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

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

Posted: 2015-08-26T08:54:18-07:00
by fmw42
Should that not be -define and not --define (one dash)?

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

Posted: 2015-08-26T11:58:16-07:00
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.

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

Posted: 2015-08-26T12:25:18-07:00
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.