You are here: Re: [PHP] imagejpeg() output « PHP « IT news, forums, messages
Re: [PHP] imagejpeg() output

Posted by Rasmus Lerdorf on 01/17/05 09:42

On Sat, 15 Jan 2005, Steven Simmons wrote:

> I'm trying to write an object oriented system for saving my uploaded
> files to a blog.
>
> I am using php to resize the original photos and save a thumbnail .
>
> When I get all done, I want to do something like this:
>
> $tempImageData = imagejpeg( $imageResource, '', 75 );
> $outputHandler -> save ( $tempImageData );
>
> Where the $outputHandler is an object that knows how/where to save the file.
> However, I've noticed that imagejpeg() only returns a number 1.
>
> This worked on my previous server, but I'm guessing my new server has a
> newer version of php.
>
> What am I doing wrong? How can i pass the raw jpeg data to a function?

What worked on your previous server? ImageJpeg has never returned the
image data. It has always either written it to the file you specify, or
if you don't specify one it will output it directly at that point. If you
want to capture it in a variable you will need to use output buffering.
See php.net/ob_start

-Rasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация