Gallery Thumbnails and Over-sized Images Not loading.

edited September 2013 in Troubleshooting
Not sure what the problem is with my gallery... Images that are larger than the window (and would be reduced in size with a link to the full size image) do not load properly, and the thumbnail images aren't loading properly either in the index or the spinner.


Please help me get this up and running. I see others have their gallery working properly so I'm hoping this is just a depreciation issue I can resolve easily.

Thanks in advance.

Comments

  • It seems it has to do with your server's php rules (perhaps memory, perhaps something else). Please contact them for support.

    If you follow the forum guidelines we would be able to better help you.
  • Sorry, I'm not sure where to find the information about my server you like to see included.

    I don't believe this is a memory problem; I was able to locate an error_log in enforcer/libraries/error_log, and the last ton of lines indicate a coding problem:

    [code]
    [19-Sep-2013 21:10:20 America/Chicago] PHP Warning:  imagejpeg(): Filename cannot be empty in /home/enforcer/public_html/enforcer/libraries/thumb.display.php on line 222
    [19-Sep-2013 21:10:20 America/Chicago] PHP Warning:  imagejpeg(): Filename cannot be empty in /home/enforcer/public_html/enforcer/libraries/thumb.display.php on line 222
    [19-Sep-2013 21:10:20 America/Chicago] PHP Warning:  imagejpeg(): Filename cannot be empty in /home/enforcer/public_html/enforcer/libraries/thumb.display.php on line 222
    [19-Sep-2013 21:10:20 America/Chicago] PHP Warning:  imagejpeg(): Filename cannot be empty in /home/enforcer/public_html/enforcer/libraries/thumb.display.php on line 222
    [19-Sep-2013 21:10:20 America/Chicago] PHP Warning:  imagejpeg(): Filename cannot be empty in /home/enforcer/public_html/enforcer/libraries/thumb.display.php on line 222
    [19-Sep-2013 21:10:25 America/Chicago] PHP Warning:  imagejpeg(): Filename cannot be empty in /home/enforcer/public_html/enforcer/libraries/thumb.display.php on line 222
    [/code]

    I'm not sure exactly how imagejpeg works, but it apparently requires a filename in that script, and it's not getting one.  That's not saying there isn't a memory issue as well, but this is definitely causing a problem.  If there's a memory error, it'll appear in that error log once this error's fixed as well (and near as I can tell it's a script problem, not a php problem, as it's not complaining about a blocked function).
  • thanks for the detailed info, that's very useful. seems you got a very annoying bug! go to /libraries/thumb.display.php on line 222 and change imagejpeg($thumb, '', $img_quality) for imagejpeg($thumb, NULL, $img_quality) and that should solve it.

    cheers!
  • In order to fix this, you may also need to make the following change to the minishowcase/libraries/thumb_display.php:

    On line 10, change E_ALL to E_NONE, so that it reads:

    error_reporting(E_NONE);

    This (in addition to the imagejpeg() fix) worked for me to repair the image resizing (thumbnails and oversize), but YMMV, of course.

    Explanation: I had minishowcase working fine on a server running PHP 5.2, but when I upgraded to PHP 5.5, I started to get these (and other) errors. Basically, some things changed in the intervening PHP versions which broke the code in a couple of ways.

    The first is that the job of thumb_display is to output an image, and any extraneous data corrupts that image. PHP is getting progressively more strict about displaying warnings, and there are now several warnings issued by this code - but they count as "extraneous data" generated by the script before the image is generated, so the image is corrupted. The E_NONE directive suppresses these warnings so that the output is clean. Documentation for some of the messaging changes can be found at http://php.net/manual/en/function.error-reporting.php

    Second, apparently PHP has also become more strict about what parameters it'll accept to the imagejpeg() function. The second parameter used to work as an empty string, but now it needs to be null. This requirement (if not the change) is documented at http://php.net/imagejpeg


    I was also getting a couple of other PHP error messages showing on the main directory page, which I cleared by making the following changes to /libraries/general.init.php.

    At line 7, add the following:

    error_reporting(E_ALL ^ E_DEPRECATED);

    The ereg_replace() function is deprecated in later versions of PHP. The real solution is to use preg_replace instead, but that requires deeper changes to the regular expressions themselves.


    Change line 100 to:

    $gd['jpg'] = $gda["JPEG Support"] || $gda["JPG Support"];

    Again, this is a version change, though this time it's in the GD library rather than PHP itself. See the Changelog section at http://php.net/gd_info ;
  • Thanks Victor and String. I made all of the suggested changes and the same problems persist.

    New Error Log:

    2013-10-03 23:03:02.105 [INFO] [88.198.219.55:51443-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 23:03:02.105 [INFO] [88.198.219.55:51443-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/robots.txt] 
    2013-10-03 23:02:09.879 [INFO] [108.170.175.54:63249-2#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 23:02:09.879 [INFO] [108.170.175.54:63249-2#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/enforcer/libraries/images/spinner.gif] 
    2013-10-03 23:02:09.755 [INFO] [108.170.175.54:63249-1#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 23:02:09.755 [INFO] [108.170.175.54:63249-1#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/enforcer/libraries/images/spinner.gif] 
    2013-10-03 23:02:02.404 [INFO] [108.170.175.54:63234-1#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 23:02:02.404 [INFO] [108.170.175.54:63234-1#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/enforcer/libraries/images/spinner.gif] 
    2013-10-03 23:02:02.226 [INFO] [108.170.175.54:63235-2#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 23:02:02.226 [INFO] [108.170.175.54:63235-2#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/enforcer/libraries/images/spinner.gif] 
    2013-10-03 23:00:48.832 [INFO] [70.210.195.216:33682-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 23:00:48.832 [INFO] [70.210.195.216:33682-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/Ryan Dickinson Portfolio/gds2009.css] 
    2013-10-03 22:54:54.110 [INFO] [108.170.175.54:63175-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 22:54:54.110 [INFO] [108.170.175.54:63175-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/(EmptyReference!)] 
    2013-10-03 22:54:19.529 [INFO] [70.210.195.216:18576-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 22:54:19.529 [INFO] [70.210.195.216:18576-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/Ryan Dickinson Portfolio/gds2009.css] 
    2013-10-03 22:50:27.879 [INFO] [70.210.195.216:50128-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 22:50:27.879 [INFO] [70.210.195.216:50128-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/Ryan Dickinson Portfolio/gds2009.css] 
    2013-10-03 22:45:47.541 [INFO] [70.210.195.216:50121-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 22:45:47.541 [INFO] [70.210.195.216:50121-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/Ryan Dickinson Portfolio/gds2009.css] 
    2013-10-03 22:43:57.933 [INFO] [70.210.195.216:50116-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 22:43:57.933 [INFO] [70.210.195.216:50116-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/Ryan Dickinson Portfolio/gds2009.css] 
    2013-10-03 22:42:05.820 [INFO] [70.210.195.216:34745-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/404.shtml] 
    2013-10-03 22:42:05.820 [INFO] [70.210.195.216:34745-0#APVH_benreillytribute.x10host.com] File not found [/home/enforcer/public_html/Ryan Dickinson Portfolio/gds2009.css]
  • I don't recommend changing the error level from 'E_ALL' to 'E_NONE' as that would only hide possible errors and make our attempts to help you more difficult.

    minishowcase should have no errors to show and if there are, they should show so we can solve them.

    That said, you're having an issue with the thumbs.display.php. This is what the file http://www.benreillytribute.x10host.com/enforcer/libraries/thumb.display.php shows:

    Notice: Use of undefined constant E_NONE - assumed 'E_NONE' in /home/enforcer/public_html/enforcer/libraries/thumb.display.php on line 10
    ÿØÿàJFIFÿþ

    Check the changes you made and restore the code to its original form.
  • Hi there!

    i got the same error :( im on XAMPP with PHP 5.4.19. I realy have no skill in PHP. Minishowcase works realy good on One.com server. But on my private XAMPP Webserver some Pictures would show a white Frame. Thumbs working!

    hope there is an idea to solve the problem! Thank you!

    Sorry bad english :)
Sign In or Register to comment.