In version 2.0, we added the multiple convert steps support.
Here are some examples with explanations.
Scale, resolution, format
An example of multiple conversion steps: the original file is scaled to 200 (keeping proportions); the horizontal resolution is set to 74dpi to X and the vertical to 78dpi; the format is changed to Jpeg:
(note: type all in the same line, the below text is wrapped only for better readability)
parser.exe d:\FADE2WHITE.png
-convert Scale -p:int 200
-out d:\fadescale.jpg
-convert SetResolution -p:int 74 -p:int 78
-convert ChangeFormat -p:string image/jpeg
The order of steps is important (crop->resize and resize->crop will return different results!).
The other parameters (like -out in this case, between two convert steps) doesn't have order restriction.
Scale, crop, convert, format
Another example of conversion with multiple steps: all the images in the specified folder are scaled to 700 (keeping proportions); cropped into coordinates 20 (top) 20 (left) 320 (bottom) 320 (right): so the result is an image 300px*300px; converted to grayscale; saved as jpegs with quality 50 into the folder "D:\outconv\".
(note: type all in the same line, the below text is wrapped only for better readability)
parser.exe \\omega\software$\Gn4Repository\Images\jpegs\*.*
-convert Scale -p:int 700
-convert Crop -p:string 20;20;320;
320 -convert ChangeColorSpace -p:string Grayscale
-convert ChangeFormat -p:string image/jpeg
-convert SetSaveOpt -p:int 50
-out d:\outconv\
This operation can fail if the original file doesn't admit the specified conversions.
Another case of fail can happen if after scale operation the size of the file isn't compatible with next crop operation: if an image that was scaled to 700 results in 700px x 250px dimensions, the crop to 320px will not be applicable.
About scaling PDFs
Multiple convert steps that include scale won't work with PDF formats. In that case the parser must be called twice: first: convert PDF to jpeg (by Parse APDFL) parser \\...\1296727.pdf -convert Change Format -p:string image/jpeg -p:int 90 -p:int 400 -out \\...\1296727.jpg second: scale output image (by Parse Img) parser \\...\1296727.jpg -convert Scale -p:int 1024 -out \\...\final.jpg
When parser.exe recognizes a PDF it enters in PDF mode so it works only with operations PDF-compatible: scale is not among the allowed operations. Running a new parser.exe call, the file is now an image, so the scale step is allowed.