Convert images when extention is not in the filename using ImageMagick

Issue

I would like to convert a jpg image to a pdf file using ImageMagick convert. I can successfully do so using the following:

convert image.jpg image.pdf

How could I convert the image if the original file name was “image” and not “image.jpg”, and the target file name is “image” and not “image.pdf”?

Solution

You can use Explicit Image Format to force convert to use a specific format, regardless of filename.

convert jpg:image_source pdf:image_out

Answered By – emcconville

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published