You can set an output file name which is made from the input file name. Using the same example command I used above, and adding a variable with "-set filename:f", then naming the output file with that variable, we end up with a command like this...pctechtv wrote:I'm thinking there must be an option to leave off the last part with the output directory and tell ImageMagick just to create the jpeg in the original file's directory. If so how is this done? Thanks
Code: Select all
magick -density 300 mypdf.pdf[0] -set filename:f "%[d]/%[t]" ^
-crop %[w]x%[fx:w/16*9]+0+0 +repage -resize %[fx:resolution.x*8.5]x "%[filename:f].jpg"
Read more about how you can use those IM built-in variables at this LINK. That's why they call it ImageMagick.