PHP Thumb » Help & Bugs » Bugs

Remote Images - Fatal Error

(4 posts)
  1. zactanaz
    Member

    This is a amazing library, easy and simple to use.

    I found out the when you point to a remote image to generate a thumb is gives a Fatal Error.

    Here it is:


    Fatal error: Uncaught exception 'Exception' with message 'Image file not found: http://www.sample.com/sub-dir/image.jpg' in C:\xampplite\htdocs\includes\ThumbBase.inc.php:165 Stack trace: #0 C:\xampplite\htdocs\includes\ThumbBase.inc.php(144): ThumbBase->triggerError('Image file not ...') #1 C:\xampplite\htdocs\includes\ThumbBase.inc.php(93): ThumbBase->fileExistsAndReadable() #2 C:\xampplite\htdocs\includes\GdThumb.inc.php(96): ThumbBase->__construct('http://www.sampl...') #3 C:\xampplite\htdocs\includes\ThumbLib.inc.php(127): GdThumb->__construct('http://www.sampl...', Array) #4 C:\xampplite\htdocs\twistys\images.php(14): PhpThumbFactory::create('http://www.sampl...') #5 {main} thrown in C:\xampplite\htdocs\includes\ThumbBase.inc.php on line 165

    Is there a workaround this problem?

    If PHPThumb does not support this feature it would be nice if you could add support for this.

    Thanks
    Zactanaz

    Posted 2 years ago #
  2. Well, you could catch the exception ;)

    Basically the library can't open the file (hence the "Image file not found" error), so it throws an exception.

    As to the remote image portion of your question, I've never tried it myself, but typically with remote files, you'd need to make sure "allow_url_fopen" is enabled in your php.ini file. But, the class wouldn't really deal with it properly still. I could probably get something whipped up in the near future... can you file an enhancement request over at http://trac.gxdlabs.com/projects/phpthumb/newticket

    Posted 2 years ago #
  3. zactanaz
    Member

    I have found workarounds, but it does not involve the library by using cURL or the function "file_get_contents" to create an image from string, but that's not really what I wanted to do.

    Thanks for the quick answer.

    Posted 2 years ago #
  4. Added support for remote images in the latest version, just released :)

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.