I can't seem to figure out the best way to crop and resize to an exact target width and height.
My code:
Code: Select all
convert \
"001.jpg" \
-auto-orient \
-crop 3026x3072+1579+0 \
-gravity Center \
-resize 2622x2660^ \
-density 304x304 \
-quality 100 \
-depth 8 \
-units PixelsPerInch \
-strip \
+profile '*' \
+repage \
cropped-and-resized.jpg
Unfortunately, the cropped results are unpredictable and not 2622x2660.
Also note that some of these images have orientation data straight from camera, that's why I am using auto-orient. Part of me wonders if the orientation info is creating an issue with the crop and resize?
Can anyone see where I am going wrong?
Thanks so much in advance for the help!