imagecopyresampled() Help Needed

This is a discussion on imagecopyresampled() Help Needed within the alt.comp.lang.php forums, part of the PHP Programming Forums category; When I execute this script, nothing displays on my browser. I'm trying to verify my image is being reduced ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-27-2005
ralphNOSPAM@primemail.com
 
Posts: n/a
Default imagecopyresampled() Help Needed

When I execute this script, nothing displays on my browser. I'm trying
to verify my image is being reduced by 50% before I try to write it to
a file:

// The file
$filename = "/home/public_html/radar2.jpg";
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width,
$new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:45 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0