U
U
Unicom2013-09-17 13:18:36
Debian
Unicom, 2013-09-17 13:18:36

Bulk recursive image resolution reduction?

Task:
Recursively catch all pictures and for those whose resolution is more than 1280 pixels on the larger side (72dpi), respectively, reduce them to these same 1280 pixels on the larger side / 72dpi.
Parsing the internet for several days resulted in the formation of the following console command:

find /input/ -iname "*.*" -print0 | xargs -0 mogrify -resize 1280/ -quality 70 -density 72

However, it works in a strange way - sometimes it reduces the image in accordance with my parameters, and sometimes it reduces it to 1280pix on the smaller side. Regularities could not be identified.
Tell me where I made a mistake or what console command is better to use for my task?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rakeev, 2013-09-17
@rakeev

Your resize reduces to 1280 in width, height is not taken into account at all. Need -resize '1280x1280>'
www.imagemagick.org/www/command-line-processing.html#geometry

@
@sledopit, 2013-09-17
_

Try using 1280x1280 instead of 1280/:

find /input/ -iname "*.*" -exec convert {} -resize 1280x1280 -quality 70 -density 72 {} \;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question