Page 1 of 1

-extract help needed please

Posted: 2008-09-22T12:53:57-07:00
by lampstax
I've spent a bit of time googling for the answer but thank god I found this forum. I installed latest version of IM on both my local (windows binary install of version 6.4.3.7) and on dev environment at work (6.0.7.1 on redhat using up2date imagemagick).

Out of the box, on my local version, IM did what it was supposed to do. It works perfectly. Portions of the image get extracted out and that portion gets resized down the the thumbnail size.

On dev, the -thumbnail portion seems to work just fine, and it would resize the image, but it would not extract the portion I want it to extract. It just resize the entire image.

I am issuing via php's passthrough function the command:

Code:

convert -format jpeg -extract 1024x768+0+0 -thumbnail 600x450 /var/www/html-dev/images/managed/blogimage_raymanravingrabbids2shrek1163_1222111681.jpg /var/www/html-dev/images/managed/blogimage_raymanravingrabbids2shrek1163_1222111681.jpg_thumbs_600x450

On my windows local version, it works perfectly fine.

Is there any linux config for IM that could possibly have this effect ? Or is it the version differences ? I'm pretty much stumped. Google is not my friend for this one.

Re: -extract help needed please

Posted: 2008-09-22T13:00:38-07:00
by fmw42
This may not make a difference, but the current IM syntax is, for most options

convert input options output

not

convert options input output


see
http://www.imagemagick.org/Usage/basics/#cmdline

So try

convert -format jpg -extract1024x768+0+0 inputimage -thumbnail 600x450 outputimage

P.S.

I don't know the lineage of -extract, but it is possible it is a more recent addition than the IM on your dev machine. 6.0.7.1 is rather old. Can you update that to the current release?

Alternately, you can use -crop after reading in the image or just subsection the input image as

convert inputimage[1024x768+0+0] -thumbnail 600x450 outputimage

or

convert inputimage -crop 1024x768+0+0 -thumbnail 600x450 +repage outputimage

Not sure why you need -format jpg if the input image is already a jpg?

Re: -extract help needed please

Posted: 2008-09-22T13:08:35-07:00
by Bonzo
I would guess its a version problem.

Run this on your server and look at the system ("convert -list Command") section - is extract displayed ?

Code: Select all

<?php
// Build the array of items to be used
exec("convert convert -list list", $IMarray, $code);
// Start the loop to find and display the results
foreach ($IMarray as $value) {
echo "<br>system (\"convert -list $value\")";
echo "<pre>";
system("convert -list $value");
echo "</pre><hr>";
}
?>

Re: -extract help needed please

Posted: 2008-09-29T13:59:55-07:00
by lampstax
Thanks for all the help guys !

Took about 3 days to just get the update done .. pushing the request through the proper channels and get the proper approval / budget for the update (LOL) .. but in the end, I updated to the latest version of IM and it worked great.