/ Published in: PHP
URL: http://www.randomsequence.com/articles/making-square-thumbnails-with-imagemagick/
Expand |
Embed | Plain Text
<?php $SQUARESIZE = 108; // the size in pixels for your square images $convertPath = "/usr/local/bin/convert"; // full path to ImageMagick's convert tool $n = 0; $originalname = $file; $filenamePart = $n++; $squarename = $filenamePart."_sq.jpg"; $squareCommand = $convertPath." \"".$path.$originalname."\" -thumbnail x".($SQUARESIZE*2)." -resize '".($SQUARESIZE*2)."x<' -resize 50% -gravity center -crop ".$SQUARESIZE."x".$SQUARESIZE."+0+0 +repage -format jpg -quality 91 \"".$path."sq/".$squarename."\""; } } } ?>
You need to login to post a comment.
