Has anyone used this combination before. I am working on a project and have a fairly good idea of how it should work. But never having used imagemagick before I am a little sketchy on the proper procedure.
Any help is great appreciated.
Php & ImageMagick
Moderator: General Moderators
Ok, maybe I am not understanding this as much as I thought I was.
Here's the scenario.
Have a image named car.jpg in dir images/upload
The image car.jpg is 300 x 300
I want to use imagemagick to convert the image to display it at 120x120 in a table. How do I call the imagemagcik command and can I do it on the fly?
Thanks
Here's the scenario.
Have a image named car.jpg in dir images/upload
The image car.jpg is 300 x 300
I want to use imagemagick to convert the image to display it at 120x120 in a table. How do I call the imagemagcik command and can I do it on the fly?
Thanks
-
samscripts
- Forum Commoner
- Posts: 57
- Joined: Tue Apr 23, 2002 4:34 pm
- Location: London, UK
I think the command you need is 'convert' which should exist in the imagemagick directory.
exec("/path/to/imagemagick/convert -scale 120x120 images/upload/car.jpg /path/to/save/in/car.jpg")
http://www.imagemagick.org/www/convert.htm
I'm not sure if its the -scale or the -resize argument that you need. As to doing it on the fly, I'm not sure if ImageMagick will output directly to the browser like this, but it probably can if you read the manual.
If not, you could just generate the thumbnail and save it to disk, then readfile() it, then delete the generated thumbnail.
hope this helps, Sam
exec("/path/to/imagemagick/convert -scale 120x120 images/upload/car.jpg /path/to/save/in/car.jpg")
http://www.imagemagick.org/www/convert.htm
I'm not sure if its the -scale or the -resize argument that you need. As to doing it on the fly, I'm not sure if ImageMagick will output directly to the browser like this, but it probably can if you read the manual.
If not, you could just generate the thumbnail and save it to disk, then readfile() it, then delete the generated thumbnail.
hope this helps, Sam
Does look right to you,hedge wrote:I use it to build thumbs, I simply use system calls from php.
$abpath = absoulte path to images.
I am taking image resizing and saving as thumbnail
Code: Select all
system("/usr/local/bin/imagemagick/convert -size 75x75 $abpath/$img1_name -resize 75x75 $abpath/$img1_thumbnail_name");