One line of code
May 2006
Programming can be a pain in the ass. Take this command for example:
convert -resize 310x155 -size 310x155 \
+swap -gravity center
-composite input.jpg background.jpg
output.jpgThat took three hours to figure out.
That command automatically resizes an image to fit inside a 310 pixel wide by 155 pixel high area with a background image padding out any missing space.
It's simple, now that I have it. Making it was a lot of work. The documentation was hard to parse and specific examples didn't exist.
The Result
If you're interested in what it does, here's the before and after


end of line