Append is no longer working

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?".
Post Reply
tin_acton
Posts: 2
Joined: 2013-04-01T12:10:34-07:00
Authentication code: 6789

Append is no longer working

Post by tin_acton »

I use the following command in a script once a month for batch conversions:

Code: Select all

convert -size 612x792 -density 150 $i -append png8:"${i/.pdf}".png
This month is was brought to my attention that only the first page is appearing. When I looked closer all I see are multi-paged PNG files, but not a single PNG file that contains the entirety of the original PDF.

When I convert to JPG or GIF, I get a single paged image file.

I don't see anything wrong with the syntax and nothing else in the workflow changed, so I'm not sure why append is suddenly no longer working.

EDIT: Works as it should on Windows 8. The above problem appears to occur only on OS X 10.7 with ImageMagick installed through Ports.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Append is no longer working

Post by fmw42 »

What is $i?

Is it an index or a given multipage file or a list of files?

Please clarify your problem and give a better example with images substituted. How are you looping over your input images or is it just one image with multiple pages such as a pdf.

Note PNG does not support a single multi-page file structure. It will create one output file when using -append that will stack all the pages vertically in the output.

This works fine for me under IM 6.8.4.5 Q16 Mac OSX Snow Leopard.

# create multi-page pdf
convert rose: rose: rose: rose.pdf

# vertically append all the pages into one single png
convert rose.pdf -append rose_append.png
tin_acton
Posts: 2
Joined: 2013-04-01T12:10:34-07:00
Authentication code: 6789

Re: Append is no longer working

Post by tin_acton »

How are you looping over your input images or is it just one image with multiple pages such as a pdf.
Sorry for the confusion, here is a section of the relevant script:

Code: Select all

#!/bin/bash
for i in `ls *.pdf`
  do
        convert -size 612x792 -density 150 02-05-13_951.pdf -append png8: "${i/.pdf}".png;
done
It would be similar to this:

Code: Select all

        convert -size 612x792 -density 150 file_input.pdf -append png8:file_output.png
Note PNG does not support a single multi-page file structure.
I must have been incorrect in my observations - I'm not sure what I was previously looking at if this is the case. Please ignore. Original problem persists with single page.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Append is no longer working

Post by fmw42 »

convert -size 612x792 -density 150 02-05-13_951.pdf -append png8: "${i/.pdf}".png;
This may be a typo but there should be no space after PNG8: and the output.

try my example above and see if it works or not. What version of IM are you using? What is the version of Ghostscript that is needed to read the pdf file?
Post Reply