note 41130 deleted from function.getimagesize by cmb
| From: | cmb@php.net | Date: | Sun, 18 Dec 2016 09:46:12 +0000 |
| Subject: | note 41130 deleted from function.getimagesize by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208642@lists.php.net to get a copy of this message | ||
Note Submitter: MagicalTux at FF.st
----
simm posted something interesting about imagick, but usually calling an external binary is not the
best way.
You can use the Imagick PHP module . With it, you do not even need to get the image size to generate
thubnails...
Here's the code I used :
<?php
$imh=imagick_readimage($image);
imagick_scale($imh,GALLERY_THUMBNAILWIDTH,GALLERY_THUMBNAILHEIGHT);
imagick_writeimage($imh,$image_thumb);
?>
(I noticed that some hosting companies are now providing the imagick module by default. Using it
allows you to accept any type of image from your visitors. Maybe it will be documented on the
official PHP website one day or another? )