resize thumbnails of different proportion to fit output size
Posted: 2015-09-11T14:02:17-07:00
I have folder with photos of different orientation. Portrait and album.
But I need to resize them to fit 234x180 thumbnail without white segments.
Now I use code below to solve this issue. So I have separate folders to store portrait and album pictures.
I'm interested maybe it is possible to do the same easier using imagemagick special options?
But I need to resize them to fit 234x180 thumbnail without white segments.
Now I use code below to solve this issue. So I have separate folders to store portrait and album pictures.
I'm interested maybe it is possible to do the same easier using imagemagick special options?
Code: Select all
smartresize() { mogrify -path $1 -thumbnail $2 $3 }
smartresize public/img/news/ 234 'resources/img/news/portrait/*'
smartresize public/img/news/ x180 'resources/img/news/album/*'
cd public/img/news
for f in *.*
do convert $f -gravity center -extent 234x180 $f;
done