Re: Copy of image -> smaller
| From: | Gustav Wiberg | Date: | Mon, 15 May 2006 07:39:34 +0000 |
| Subject: | Re: Copy of image -> smaller | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236175@lists.php.net to get a copy of this message | ||
Hi there!
If I understand this right, I must have adminstration rights for installing Magic Wand...
The problem is that my host doesn't have any support for this application. (It's not MY server)
Is there any workaround?
Best regards
/Gustav Wiberg
----- Original Message ----- From: "Sascha Braun" <contact.saschabraun@web.de>
To: "Gustav Wiberg" <gustav@varupiraten.se>
Sent: Monday, May 15, 2006 9:18 AM
Subject: Re: [PHP] Copy of image -> smaller
I dont have the code you need handy at the moment, but please take a look at imagemagick.org and the convert -size 120x80 in.jpg -resize 120x80 out.jpg command. First you have to use gd getimagesize command to find out the width and height of the uploaded image, to find out if the image has a higher width or height value. The scale it down by the factor needed. 200 / 120 * factor i guess. Don't forget the path in the convert command otherwise you are going to delete the original image. Normaly i do a copy(/tmp/file, /to/destination/path); unlink(/tmp(file); convert original source path to thumbnail destination path and so forth. When you get handy with ffmpeg you can do the same stuff with movies. Lame helps you to do the same with audio files. Have fun! Sascha Braun _______________________________________________________________ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192