Creating multiple thumbnails without re-reading original
Posted: 2011-07-05T08:38:38-07:00
I'm trying to create multiple thumbnails of different dimensions from an original without re-reading the original each time, in a single convert command.
The command that seems to work best is:
I'm wondering if there's a better way?
I've tried +clone, which seems to be slightly slower than mpr:
And I've also tried +write, but it seems that each thumbnail uses the output of the previous thumbnail instead of the original. In this code, the 900> thumbnail will be the same as the x150> thumbnail.
Any tips would be appreciated. Thanks!
The command that seems to work best is:
Code: Select all
convert 'original.jpg' -write mpr:orig +delete \
mpr:orig -resize 'x150>' -write '150.jpg' +delete \
mpr:orig -resize 'x400>' -write '400.jpg' +delete \
mpr:orig -resize '900>' '900.jpg'
I've tried +clone, which seems to be slightly slower than mpr:
Code: Select all
convert 'original.jpg' \
\( +clone -resize 'x150>' -write '150.jpg' \) -delete 1 \
\( +clone -resize 'x400>' -write '400.jpg' \) -delete 1 \
-resize '900>' '900.jpg'
Code: Select all
convert 'original.jpg' -resize 'x150>' +write '150.jpg' \
-resize '900>' +write '900.jpg' \
-resize 'x400>' '400.jpg'