Reply to Re: PHP dies when you use imagecreatefromjpeg()

Your name:

Reply:


Posted by comp.lang.php on 04/10/06 18:51

Erwin Moller wrote:
> comp.lang.php wrote:
>
> > PHP version 4.3.9
> > GD version 2.0.2
> >
> > Whenever I use imagecreatefromjpeg(), PHP completely dies. No errors,
> > no warnings, no notices, it dies in the following manner:
> >
> > If using Firefox it just stops running cold
> > If using Konqueror you get the message "An error occurred while
> > processing http://www.blah.com/tools/app"
> >
> > I can't get any more information than that. Has anyone run into this
> > before?
> >
> > Thanx
> > Phil
>
> Hi Phil,
>
> If you want to debug imagecreation scripts, you need some way to get to the
> errors.
> If you have a PHP script that returns an image (content-type: image/png etc
> etc) I found the easiest way to change the header of that script into
> text/html, in that way if you call the script directly, you'll see the
> errors.
> Of course, you can also let PHP log errors (from php.ini) and find them in
> the logfile.
> In both cases, make sure you have errorreporting on, to E_ALL & E_STRICT
>

Sorry I did all of that, including putting the line
error_reporting(E_ALL & E_STRICT) right before the
imagecreatefromjpeg() functional command, to no avail.

Furthermore, nothing noted in the error logs in php nor httpd. Here is
the code:

// ATTEMPT TO CREATE IMAGE OBJECT BASED UPON PHP GD FUNCTION CALL
BASED ON IMAGE MIME TYPE
if ($this->isSuccessful) {
$func = $functionArray[$type];
if ((int)$willDownload === 1) {
//eval('$image = $func("$tmpImageDownloadDir/" .
$this->fileName);'); // CREATE IMAGE OBJECT FROM TEMP DIRECTORY
$image = imagecreatefromjpeg("$tmpImageDownloadDir/"
.. $this->fileName);
} else {
//eval('$image = $func("$locationPath/" . $this->fileName);'); //
CREATE IMAGE OBJECT OF APPROPRIATE MIME TYPE
$image = imagecreatefromjpeg("$locationPath/" .
$this->fileName);
}

I checked and the image exists, the file directories exist, and
phpinfo() reveals that GD is enabled.

Phil

> Hope that helps.
>
> Regards,
> Erwin Moller

[Back to original 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

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