imagemagick - what is best way to rotate an image using php or convert command? -


what best way rotate image using php or convert command?

use php function imagerotate
http://php.net/manual/en/function.imagerotate.php

example:

<?php // file , rotation $filename = 'test.jpg'; $degrees = 180;  // content type header('content-type: image/jpeg');  // load $source = imagecreatefromjpeg($filename);  // rotate $rotate = imagerotate($source, $degrees, 0);  // output imagejpeg($rotate);  // free memory imagedestroy($source); imagedestroy($rotate); ?> 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -