Re: newbie: contents will not output

From: Date: Tue, 11 Mar 2003 16:19:36 +0000
Subject: Re: newbie: contents will not output
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-139137@lists.php.net to get a copy of this message
Hugh, That script works fine. Thank you. What I am trying to achieve is to pull a .jpeg from a remote URL and then resize and/or crop it after it is placed in a variable. Your script is able to open and read the original file for output. In the following script, I have the variable $contents holding the file - bar.jpg - which is - say 1000x1000 - and I am trying to reduce the size of that file to 300x300. I have php_gd libraries installed. Many thanks, Tony Ritter ........................................... <? $file_to_open="http://www.foo.com/bar.jpg"; $fp=fopen($file_to_open,"r"); $contents=fread($fp,1000000); //reads to eof or ~10K whichever comes first $new_w=300; $new_h=300; $dst_img=ImageCreate($new_w,$new_h); $src_img=ImageCreateFromJpeg($contents); ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),I mageSY($src_img)); ImageJpeg($dst_img); fclose($fp); ?> --- [This E-mail scanned for viruses by gonefishingguideservice.com]

« previous php.general (#139137) next »