Resizing/Cropping and Appending 4 images

bash, imagemagick

Solution

Try to resize the image to the same size.

for i in *.jpg; do convert $i -resize 80x80 -quality 90 $i.jpg; done

Now you can append images.

Appending images before resizing

Appending images after resizing

Problem

I'm currently using this command to resize images using imagemagick: ``` convert \( ${files[0]} ${files[1]} -append \) \( ${files[2]} ${files[3]} -append \) +append $dir.jpg ``` What is the best way to deal with images which dimensions differ like in the second picture? can I specify specific width or height and make the image resize and crop to that size if its smaller and crop the center if its really hight so I always get the result like in first picture? Thanks!

Original source