[PHP] Copy of image - smaller

2006-05-15 Thread Gustav Wiberg
Hi there! When I upload a picture from a form, then I want to create a copy with a smaller image. For example: I upload a picture with dimensions 200x150 name 4.jpg. I also want a copy of this image but with the dimensions 100x75 pixels. I've tried this below, but I'm missing something I

Re: [PHP] Copy of image - smaller

2006-05-15 Thread Gustav Wiberg
: Sascha Braun [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] 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

Re: [PHP] Copy of image - smaller

2006-05-15 Thread Chris
Gustav Wiberg wrote: Hi there! When I upload a picture from a form, then I want to create a copy with a smaller image. For example: I upload a picture with dimensions 200x150 name 4.jpg. I also want a copy of this image but with the dimensions 100x75 pixels. I've tried this below, but I'm

Re: [PHP] Copy of image - smaller

2006-05-15 Thread Rabin Vincent
On 5/15/06, Gustav Wiberg [EMAIL PROTECTED] wrote: [snip] //What should/could I do here? // //Set new width and height // $new_width = 100; $new_height = 200; $tmp_image=imagecreatefromjpeg($toPath . $mfileAdd); $width =

Re: [PHP] Copy of image - smaller

2006-05-15 Thread Gustav Wiberg
- Original Message - From: Chris [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Cc: PHP General php-general@lists.php.net Sent: Monday, May 15, 2006 9:42 AM Subject: Re: [PHP] Copy of image - smaller Gustav Wiberg wrote: Hi there! When I upload a picture from a form, then I

Re: [PHP] Copy of image - smaller

2006-05-15 Thread Gustav Wiberg
- Original Message - From: Rabin Vincent [EMAIL PROTECTED] To: Gustav Wiberg [EMAIL PROTECTED] Cc: PHP General php-general@lists.php.net Sent: Monday, May 15, 2006 1:35 PM Subject: Re: [PHP] Copy of image - smaller On 5/15/06, Gustav Wiberg [EMAIL PROTECTED] wrote: [snip] //What

Re: [PHP] Copy of image - smaller

2006-05-15 Thread Richard Lynch
I'd make a wild guess that the FTP stuff isn't working... Your biggest mistake is a total lack of error-handling... On Mon, May 15, 2006 2:03 am, Gustav Wiberg wrote: Hi there! When I upload a picture from a form, then I want to create a copy with a smaller image. For example: I upload

Re: [PHP] Copy of image - smaller

2006-05-15 Thread Alberto Ferrer
For that i recomend detect the MIME, my 2 cents: function image_get_info($image) { $details = array(); $data = @getimagesize($image); if (is_array($data)){ $types = array( '1' = 'GIF', '2' = 'JPEG', '3' = 'PNG', '4' = 'SWF', '5' = 'PSD', '6' = 'BMP', '7' = 'TIFF',

Re: [PHP] Copy of image - smaller

2006-05-15 Thread Richard Lynch
On Mon, May 15, 2006 7:09 pm, Alberto Ferrer wrote: For that i recomend detect the MIME, my 2 cents: function image_get_info($image) { $details = array(); $data = @getimagesize($image); if (is_array($data)){ $types = array( '1' = 'GIF', '2' = 'JPEG', '3' = 'PNG',