Thumbnail and picture does not display on the Web

ZenPhoto seems like a great way to show pictures on the 'Net, but so far I am unable to do so.

I installed ZenPhoto 1.4 in the root directory of my commercial web hosting account. PHP, MySQL and javascript all work on the Apache server and I hand-coded a site that displays text contained in a MySQL database via PHP and MySQL commands. So far, so good....

After downloading and installing ZenPhoto, I created the appropriate database with a user and a password as per the instructions.

When I create a gallery, then an album, then upload a photo into the album, there is no thumbnail image for the gallery and the picture does not display when viewing the live ZenPhoto page in a browser. I have spent a fair bit of time looking for commands that might activate the picture, but no luck. I am troubling my fellow photo enthusiasts here because I am stumped. Help would be much appreciated.

The .htaccess file is as follows. To get it into an editor to view I had to change permissions on my account on the server to allow me to write to the file:

htaccess file version 1.4.12;

Rewrite rules are now handled by PHP code

See the file "zenphoto-rewrite.txt" for the actual rules

#

These rules redirect everything not directly accessing a file to the Zenphoto index.php script

#

IndexIgnore *


RewriteEngine On

RewriteBase /~machead2/zenphoto/

RewriteCond %{REQUEST_URI} !(/$|.)
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]

RewriteRule ^.*/?$ index.php [L,QSA]

Comments

  • acrylian Administrator

    I assume you did not really install 1.4 (seven years old from 2011) so I hope it is at least 1.4.14. Current version btw is 1.5.

    As usual please review your error logs (PHP and ZP's own debug log) as we are otherwise guessing around.

  • chuanist Member

    Pictures not displaying doesn't ring a familiar bell?

  • acrylian Administrator

    Do you want me to guess or do you want a solution? Look at the logs please.

  • csc Member

    Hi, a newbie here, please bear with me. I encountered the same problem as chuanist: I created a gallery with three images in it. But instead of 4 thumbnails representing the gallery and the 3 images, I got 4 small x'es. However when I clicked in the gray area where a thumbnail is supposed to be, it brings me to the correct image.

    Below are some details:
    (1) Installed version: 1.4.14

    (2) Debug log shows the following messages repeatedly
    {228925:Tue, 05 Jun 2018 10:11:14 GMT}
    WARNING: imagecreatetruecolor(): Invalid image dimensions in /home/abc/public_html/xyz/zenphoto/zp-core/lib-GD.php on line 134
    imagecreatetruecolor called from zp_createImage (lib-GD.php [134])
    from cacheImage (functions-image.php [361])
    from i.php [165]
    {228925:Tue, 05 Jun 2018 10:11:14 GMT}
    WARNING: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/abc/public_html/xyz/zenphoto/zp-core/lib-GD.php on line 193
    imagecopyresampled called from zp_resampleImage (lib-GD.php [193])
    from cacheImage (functions-image.php [362])
    from i.php [165]

    {270650:Tue, 05 Jun 2018 10:29:55 GMT}
    cacheImage(/2018-Summer/IMG_0732_100_cw-40_ch-40_thumb.jpg) exception: Invalid image geometry
    {270654:Tue, 05 Jun 2018 10:29:56 GMT}
    cacheImage(/2018-Summer/IMG_0754_100_cw-40_ch-40_thumb.jpg) exception: Invalid image geometry
    {270655:Tue, 05 Jun 2018 10:29:56 GMT}
    cacheImage(/2018-Summer/IMG_0757_100_cw-40_ch-40_thumb.jpg) exception: Invalid image geometry
    ...
    {279015:Tue, 05 Jun 2018 10:38:58 GMT}
    cacheImage(/2018-Summer/IMG_0754_100_cw100_ch-40_thumb.jpg) exception: width or height exceeds limit /home/abc/public_html/xyz/zenphoto/cache/2018-Summer-Picnic/IMG_0754_100_cw100_ch-40_thumb.jpg' @ error/jpeg.c/WriteJPEGImage/2158 {292200:Tue, 05 Jun 2018 10:38:58 GMT} cacheImage(/2018-Summer/IMG_0757_100_cw100_ch-40_thumb.jpg) exception: width or height exceeds limit /home/abc/public_html/xyz/zenphoto/cache/2018-Summer-Picnic/IMG_0757_100_cw100_ch-40_thumb.jpg' @ error/jpeg.c/WriteJPEGImage/2158

    (3) The thumbnail images can be found in directory public_html/xyz/zenphoto/cache/2018-Summer/. For each original image, a number of thumbnails of different dimensios are created. Peculiarly, all of the 100X40 thumbnails are empty (size 0). Those are said to have " width or height exceeds limit " in the Debug log messages above. Others thumbnails can be viewed and seemly ok.

    (4) I installed zenphoto through the web hosting service I am using. After installation, I created a gallery, installed uploader_http plugin, then uploaded 3 images as I said before. Since I could not find a tutorial, I groped around a little. Sorry if my problem is the result of me screwing up the env in the process.

  • acrylian Administrator

    Without seeing the images itself, it could be corrupt image meta data or even image too large dimensionwise for the server (although that would be a different error).

    If you can please post a link to the site, please do so. A full image to test would be good, too. If you don't want to link, you can contact us via our contact form.

  • csc Member

    Hi acrylian, I've sent you a link to my site via contact form. Thanks.

  • acrylian Administrator

    I don't see any mail yet. Let's give it some more time, sometimes it takes a while.

  • csc Member

    Good morning acrylian. Here is link to my site http://www.ezfig.com/chunshi2/zenphoto/
    Hope it helps to get us over the bump,

  • acrylian Administrator

    I did take a look and the image do work on my local test server.

    But I notice that the cache filename of the square thumbs is wrong:
    IMAG2328_100_cw100_ch-40_thumb.jpg The part ch-40 should if be ch40 actually. On current Zenphoto 1.5. the name would be a bit different.

    Please try the following:

    • Enable the cacheManager plugin and clear the cache via the "Purge Image Cache" button on the Overview page on the backend.
    • Check the image options on Option > Theme and set "thumb size" to 100 and on "Crop thumbnails" both values to 0.
    • Now revist the actual website and hopefully it helps.

    Report back if you had any or no success.

    I have no other idea and don't remember any specfic bug in this area (we had a related one but it never affected standard thumbs this way).
    Also an upgrade to 1.5 could be a good idea in the long run ;-)

  • csc Member

    acrylian, after applying the steps, the thumbnails showed up correctly. Thank you.

    In my env, I accidentally set the 2nd value (% top & bottom) of "Crop thumbnails" to 70%. I guess this causes the problem. But it shouldn't be a fatal mistake the prevents thumbnails from showing, right?

  • acrylian Administrator

    Well, depends apparently. The setting is a bit abstract with its percentage values instead of real pixels. It is percentage actually because you could otherwise set 200x200 croppingwhich could cause trouble on a e.g. 150x150 image. I would guess that your high setting caused exactly that, to crop more image than there was image avaialble.

    With your info we will try to reproduce this and perhaps can add something to avoid such issues.

  • Not really sure why you get to rename the images in the cache folder! All you ended up doing was killing a WordPress plugin, that I've been using for years!

    So ended up having to use a old version of functions-basic.php, functions-image.php and i.php to get it working again!

    Not happy at all!

  • acrylian Administrator
    edited June 11

    Not really sure why you get to rename the images in the cache folder! All you ended up doing was killing a WordPress plugin, that I've been using for years!

    Sorry for, I neither know which WordPress plugin that is or what it does nor is this my responsibility that third party tools still work. Probably its author has not maintained it well so it is not compatible anymore, especially if you use it "for years". You cannot expect that. Contact the author if he still supports the plugin.

    So ended up having to use a old version of functions-basic.php, functions-image.php and i.php to get it working again!

    it is of course not recommended to do this. If you mix files from different releases you may run into further trouble. If you get downstream problems because of this you are on your own here.

  • Not really sure why you get to rename the images in the cache folder! All you ended up doing was killing a WordPress plugin, that I've been using for years!

    Does anyone know, what is the last known version of Zenphoto, what works with the Zenphoto Press plugin for Wordpress? Becuse I can't use it with ZP 1.4.14 and I want to try to integrate webpage with ZP galleries, in this moment for testing purposes :smile:

  • acrylian Administrator

    The plugin says 1.4 so you would have to try that.It even has a warning regarding WP itself.

    Anyway, we really can't recommend to use older Zenphoto releases in the long run. Maybe investigate if you really need WP and if the Zenpage CMS plugin would be sufficient ;-)

  • acrylian Administrator
    edited July 17

    I have taken a quick look at the plugin. It seems to directly call the database which might not really sufficient for some rights inheritance. Also I don't understand some table names if those are meant to be Zenphoot tables. I didn't dig into it but Zenphoto has no tables of the names I spotted. Also it seems to use mysql instead of mysqli or pdo for db access which would make it incompatible with PHP 7+.

  • czatowiec Member
    edited July 17

    After some tests, it works with 1.4.14 and PHP7 on the bottom of it, when PHP version of Wordpress hosting is downgraded to 5.6. This version of ZP isn't very old, so probably I will try to fix this plugin, and then update ZP to 1.5 :smile: I know about Zenpage, but I try to build a website using separate CMS for webpage/blog, discuss board, and photogallery ;) I was trying to use 4images many years ago, but Zenphoto looks like better for me with many functions :) In this moment, I use Getsimple CMS on https://shift.org.pl/ and ZP on https://galeria.shift.org.pl, but I am testing migration from GS to WP, and integrate galleries below articles about trams and buses with Zenphoto, not using separate gallery scripts for webpage ;)

    Testpage with integrated photogallery from ZP is here: http://test.shift.org.pl/2018/07/16/zv155/

    Plugin doesn't work with dynamic albums. It would be great function, because this is very good in ZP, you can create special albums for example via keywords under photos from many directories :)

  • acrylian Administrator

    All right, whatever fits your purpose :smile:

    Plugin doesn't work with dynamic albums.

    That would require a lot more changes you cannot perform by just doing db queries as these albums are not phyiscal as normal albums are.

Sign In or Register to comment.