Page 1 of 1

IM + PHP

Posted: 2007-11-07T09:38:38-07:00
by dope
This is a very stupid question. I had been using a third party php script to resize images using ImageMagick. It's outdated and doesn't work properly so I thought I'd try to use IM another way.

How do you use this? Do you need a long drawn out PHP script or should I be using some sort of interface to set this up? I basically have a directory full of images that I need to display thumb and full shots of. Do I use IM functions when I call the image on the page or what? This is what I was using previously:

Code: Select all

<img src="assets/product_thumb/magick.php/<?php echo $row_results['prdctImage_FileName']; ?>?resize(80x80)" border="0">
Thanks for any help.

Re: IM + PHP

Posted: 2007-11-07T10:23:14-07:00
by Bonzo
I assume all your resizing is done in magick.php and your image details are kept in a database.
The code must be taking the name and the resize from the image path.

What is not working ? Can you display the contents of magick.php ? I always resize my images on upload and so do not use code like this.

Do you know your ImageMagick version ? If not the piece of code below should tell you.

Code: Select all

<?php
echo "<pre>";
exec("convert -version"); 
echo "</pre>";
?> 

Re: IM + PHP

Posted: 2007-11-07T10:49:30-07:00
by dope
I have no clue. My host tells me it's the current version. I am pulling the names from the db. When I try to see what version is running only pre prints out. Thanks.

Re: IM + PHP

Posted: 2007-11-07T12:51:38-07:00
by Bonzo
The problem printing out the version could be mine; try changing exec to system:

Code: Select all

echo "<pre>";
system("convert -version"); 
echo "</pre>";
As I say the ImageMagick processing must be done within the file magick.php so we need to see the contents of that file.