Page 1 of 1

Re: Display only a part of jpg without cropping the actual file

Posted: 2008-06-05T08:58:38-07:00
by Bonzo
You would have to save this ( untested code ) as a file on its own and call from the page with <img src="code.php">

Code: Select all

<?php
$cmd = "convert image.jpg -gravity Center -crop 100x100+0+0  JPG:-";

header("Content-type: image/jpeg");
passthru($cmd, $retval);
?>
As to doing it without IM, I assume you could do it with Javascript

Re: Display only a part of jpg without cropping the actual file

Posted: 2008-06-05T16:51:15-07:00
by anthony
If you are not doing this for the web, but for a X window display use...

convert image -crop ???? miff:- | display

I very often use this to look at the results of various transformations, debugging, and trial and error option determination, without saving the resultingj image to disk.

See IM Examples, Basics, Display and Animate
http://imagemagick.org/Usage/basics/#display

Re: Display only a part of jpg without cropping the actual file

Posted: 2008-06-05T17:18:03-07:00
by fmw42
this also works

display logo:[256x256+256+128]