Resize large images to a maximum size with mogrify
bulk resize images to 2560 pixels | downscale photos command line | resize images imagemagick recursively | shrink oversized images linux | mogrify | imagemagick | images | resizeWarning, destructive. This command deletes, overwrites or changes data in a way that cannot easily be undone. Check every placeholder carefully and make a backup first.
find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) -exec mogrify -resize '2560x2560>' {} +Shrinks every image so that it fits into a square of the maximum size, keeping the aspect ratio. The > ensures that only larger images are touched and smaller ones are never enlarged. Useful after importing unedited camera photos.
Note: mogrify overwrites the originals without asking, the original resolution is lost afterwards. Make a backup first. Package imagemagick, in WordPress regenerate the thumbnails afterwards.
Also searched as
- bulk resize images to 2560 pixels
- downscale photos command line
- resize images imagemagick recursively
- shrink oversized images linux