Re: thumbnails of images
| From: | Raj Shekhar | Date: | Tue, 11 May 2004 10:46:23 +0000 |
| Subject: | Re: thumbnails of images | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185894@lists.php.net to get a copy of this message | ||
Edward Peloke <epeloke <at> echoman.com> writes:
>
> won't the gd library do this?
>
> http://www.php.net/manual/en/function.exif-thumbnail.php
I have used Imagemagick to convert images to highres to thumbsize and watermark
images. I had used GD library to do this earlier but Apache gave me some funky
memory limit exceeded errors whenever I tried to load the image bigger than 2M
using imagecreatefromjpeg . This was a problem when I was using the stock PHP
4.3.<something> + Apache2 combination that comes with Fedora Release 1.
imagecreatefromjpeg worked well when I used Red hat 9 (PHP 4.2.2 + Apache
2.0.40).
/*Using imagemagick function to watermark and resize images*/
$cmdmakethumb = "composite -size ".$thumbwidth ."x"."$thumbheight -quality
40
-compose Over -gravity center ".$GLOBALS['watermark_thumb_image']. " $filename
+profile \"*\" -resize " .$thumbwidth ."x"."$thumbheight $dstthumb
";
system($cmdmakethumb);
$GLOBALS['watermark_thumb_image'] -> gives the absolute path of the image which
has to be placed as a watermark on the thumbnail
$filename -> the absolute path of the high res image that has to be resized
$thumbwidth -> width of the thumbnail
$thumbheight -> height of the thumbnail
{had a function which gave the height and width based on high res image's width
and height}
$dstthumb -> absolute path of the thumbnail image.
I have a few functions to handle images. I can mail them offline to you if you
want.
Regards
\°°/
(oo)
+--------------------ooO-- -Ooo---------+
|Raj Shekhar |
|System Administrator |
|Media Web India |
|http://www.netphotograph.com |
+---------------------------------------+
|__|__|
|| ||
ooO Ooo