Most images display; some don't

I've installed Zenphoto (v 1.4.12) from scratch on a new host and I'm uploading my images into sub-albums via FTP. I have a problem in that the Album page displays all the thumbnails correctly, but while most of the images show correctly on the Image pages, there are several that don't. These show just the image title as a link. Clicking this link opens the full-sized image. It's the same whether I click on the thumb-nail from the album page or whether I page through the images. No amount of refreshing has any effect. Deleting and re-uploading the images has no effect. All the images are shown correctly on the Admin > Albums > Images tab. I'm using a customised version of the Basic theme but the problem is still there if I revert back to the un-modified theme.
Any suggestions what could be wrong?

Comments

  • fretzl Administrator, Developer
    Do you have a link to the site ?
  • http://fotogen.uk/zen/Mono/
    In the Places album, images 3 & 4 don't show.
    In the Musicians album, the last 2 images don't show.
  • acrylian Administrator, Developer
    Seems your server responds with "Failed to load resource: the server responded with a status of 403 (Forbidden)" according to my browser on these images.

    If there are no errors in the logs the thing all the missing images seem to have in common are spaces in their file names. Somehow that does not work with the proteced image urls your enabled. We would have to check if we can reproduce this.

    I would recommend to remove spaces etc. from filenames anyway as the image page url looks nicer then as well. Normally Zenphoto does this if uploading via the backend (if the seo_zenphoto plugin is enabled) but not via FTP naturally. We have a plugin named "seo_cleanup" for doing this after uploading. In case you want to try that.
  • I've FTP uploaded versions of the images with spaces removed from the file names. They don't display either. I deleted them and re-uploaded them via the Admin Upload tab. They still wouldn't show. I installed the seo_cleanup plugin but this made no difference. I've only just started to try the screensaver plugin. This won't display any of the rogue images: "This image failed to load".

    Incidentally I tried uploading one of these images to a previous version of this site on a different host. The image displays OK there.
  • acrylian Administrator, Developer
    Ok, if you are sure it is not the spaces, you really need to review your error logs (ZP one and server one). The image might have corrupt metadata or the original images are too large for your server to be processed (would be strange though as the thumbs apparently work). Anyway, info in the latter possible issue here. http://www.zenphoto.org/news/problems-with-albums-and-images/
  • My server error log lists messages: [host fotogen.uk] Symbolic link not allowed or link target not accessible: /homez.2/fotogenunl/www/zen/cache/Mono/Places/DSC02711ObservatoryJaipur_595.jpg

    I can't see anything untoward in the Zenphoto security or setup logs.

    These image files are not huge. I've picked one of the smallest, which is 47.7Kb. I've renamed it so it has no spaces in the file name, uploaded it and changed it's file permissions from 0604 to 0644. I've also tried a version with all metadata deleted. All to no avail.

    The thumbnail links to http://fotogen.uk/zen/Mono/Places/DSC02711ObservatoryJaipur.jpg. Instead of showing the image, this shows the image title, linked to
    http://fotogen.uk/zen/zp-core/full-image.php?a=Mono/Places&i=DSC02711ObservatoryJaipur.jpg&q=75&wmk=!&dsp=Protected view&check=dc56ff0896bd4d9f34e3e5c6e692416ac7f0791f

    Clicking this image title opens the full-sized image, so it's accessible from /zp-core but not from /cache.

    I've tried to append &debug to the url in index.php but I've not been able to do that.
  • I think I've sussed what's happening (though not why).

    The images that WON'T display are all portrait or square(ish) format. I've taken a normal landscape image which displays OK and rotated it 90 deg. Now it won't display. Rotate it a further 90 deg, so it's upside down, and it does display. If I crop the landscape image to portrait format, it no longer displays.

    This isn't immediately apparent because all the thumbnails are square and only the landscape ones display fully.
  • acrylian Administrator, Developer
    The file size is not the point, the dimensions are. You can get a huge sized jpeg very small by compressing it. That might be the problem in case the image processor may try to rotate the images which requires a bit of memory.

    Zenphoto would create symlinks to the original image if the size would be the same for the cached image. If symlinks are allowed on your server. Those apparently are but somehow it is still not working.

    Please try to set the full image link to "unprotected" on Options > image and try that. The link is then directly exposed but anyone really wanting an image can copy it anyway from the colorbox anyway (or the browser cache)
  • The problem images haven't been rotated. They are portrait-format crops of landscape images which have then been converted to JPGs with a maximum height of 580px. In fact, most of them are just copies of the image files uploaded (and still displayed correctly) on my previous installation (v 1.4.11).

    When take a portrait format image (that won't display) and pad it out with blank space on each side, I end up with a landscape image (same height) that will display.

    I've tried un-ticking "Disable hot-linking" and I've tried ticking "cache the full image". Neither of these made any difference.
  • acrylian Administrator, Developer
    Hm, I tried your images (those from the colorbox) and all worked as they should as far as I can see.

    So something must be different on your install or configuration. Is there really no new related error, notice or something in the PHP server error log?
  • I'm not familiar with these logs.

    Under Raw logs: /fotogen.uk/osl/error/ I get lots of these:

    Symbolic link not allowed or link target not accessible: /homez.2/fotogenunl/www/zen/cache/Mono/Places/DSC02372a_Dubai_Airport_595.jpg, referer: http://fotogen.uk/zen/Mono/Places/DSC02372a_Dubai_Airport.jpg
    [Mon Aug 08 15:55:24 2016] [error] [client 87.114.31.233] [host fotogen.uk] Symbolic link not allowed or link target not accessible: /homez.2/fotogenunl/www/zen/cache/Mono/Places/DSC02711ObservatoryJaipur_595.jpg, referer: http://fotogen.uk/zen/Mono/Places/DSC02711ObservatoryJaipur.jpg
    [Mon Aug 08 15:55:24 2016] [error] [client 87.114.31.233] [host fotogen.uk] Symbolic link not allowed or link target not accessible: /homez.2/fotogenunl/www/zen/cache/Mono/Places/DSC02711ObservatoryJaipur_595.jpg, referer: http://fotogen.uk/zen/Mono/Places/DSC02711ObservatoryJaipur.jpg
    [Mon Aug 08 15:55:26 2016] [error] [client 87.114.31.233] [host fotogen.uk] Symbolic link not allowed or link target not accessible: /homez.2/fotogenunl/www/zen/cache/Mono/Places/DSC02372_595.jpg, referer: http://fotogen.uk/zen/Mono/Places/DSC02372.jpg
    [Mon Aug 08 15:55:27 2016] [error] [client 87.114.31.233] [host fotogen.uk]

    Under Raw logs: /fotogen.uk/osl/ I get things like:

    87.113.92.96 fotogen.uk - [08/Aug/2016:07:53:34 +0200] "GET /zen/zp-core/i.php?a=Mono/Musicians&i=P7090065.jpg&s=80&cw=80&ch=80&q=75&c=1&t=1&wmk=%21&check=cfb9a9de6a564b290009e9d4a4c802071649ae62 HTTP/1.1" 301 - "http://fotogen.uk/zen/zp-core/admin-edit.php?page=edit&album=Mono/Musicians&subpage=2&tab=imageinfo" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

    87.114.31.233 fotogen.uk - [08/Aug/2016:16:01:43 +0200] "GET /zen/Mono/Places/DSC02711p_ObservatoryJaipur.jpg HTTP/1.1" 200 2391 "http://fotogen.uk/zen/Mono/Places/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

    87.114.31.233 fotogen.uk - [08/Aug/2016:16:01:47 +0200] "GET /zen/Mono/Places/DSC02372DubaiAirport_padded.jpg HTTP/1.1" 200 2405 "http://fotogen.uk/zen/Mono/Places/DSC02711p_ObservatoryJaipur.jpg" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

    87.114.31.233 fotogen.uk - [08/Aug/2016:16:01:48 +0200] "GET /zen/cache/Mono/Places/DSC02372DubaiAirport_padded_595.jpg HTTP/1.1" 304 - "http://fotogen.uk/zen/Mono/Places/DSC02372DubaiAirport_padded.jpg" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

    87.114.31.233 fotogen.uk - [08/Aug/2016:16:01:50 +0200] "GET /zen/Mono/Places/DSC02372.jpg HTTP/1.1" 200 2370 "http://fotogen.uk/zen/Mono/Places/DSC02372DubaiAirport_padded.jpg" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

    87.114.31.233 fotogen.uk - [08/Aug/2016:16:01:51 +0200] "GET /zen/cache/Mono/Places/DSC02372_595.jpg HTTP/1.1" 403 213 "http://fotogen.uk/zen/Mono/Places/DSC02372.jpg" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"
  • acrylian Administrator, Developer
    At least http://fotogen.uk/zen/Mono/Places/DSC02372a_Dubai_Airport.jpg is actually the link to an single image page and not to an image ifself. Enable the modrewrite suffx (normally on by default with .html) on the options.

    While that generally works without, some server security (and search engines) correctly stumble upon it as "script pretending to be an image file". Which is not exactly wrong. That does not explain why the other links work though.

    Additionally you might need to check the file/Folder permissions on your server. As you get on most full images "Forbidden - You don't have permission to access /zen/cache/Mono/Places/P4280028_FULL.jpg on this server."

    Beside that I have currently no idea.

    Also clear the image cache cache and do a database refresh (on overview) so database and file system are in sync.
  • I've wrestled with this...

    First I saw that mod_rewrite was already enabled but with the mod_rewrite suffix blank. I set this to .html and then set it back again to blank (thinking to first set up some better test files for before & after checks).

    This had the immediate effect that ALL my images now get “Forbidden - You don't have permission to access /zen/cache/Mono/Test/DSC02712_Jaipur_FULL.jpg on this server” errors when I click on the displayed images. The portrait-format images still don't display but the Title links on these result in the same Forbidden message..

    I've tried disabling mod_rewrite and setting the suffix back to .html, but neither helped.

    I've switched back to the Basic theme in all this.

    These _FULL.jpg files are in fact shortcuts. The shortcuts themselves have 0777 permission, though I can't tell where they are pointing to. I assume this is the image file in the /albums hierarchy so I set the permissions on my target file to 0777. Still no joy.

    I conclude from this that my host's server is choking on the "script pretending to be an image file" matter, so I will have to take this up with them.
  • Yes, I did purge the image cache and do a database refresh
  • acrylian Administrator, Developer
    That sounds a bit strange that enabling/disabling mod_rewrite and/or changing the modrewrite suffix has effect on the access to the cached images. Those don't use modrewrite stlye urls.

    I fear I have no idea what might be going on on your server.
  • I think I've fixed the problem.

    The image displayed on the image page is hyperlinked. And the hyperlink is a call to the script full-image.php, passing across various parameters relating to the settings on the Options >Image tab. This led me to try ticking “Protect image cache”.

    Problem solved, it seems.

    All the images now display – landscape- and portrait-format. And they all allow me to open the full-sized images.
  • acrylian Administrator, Developer
    The image displayed on the image page is hyperlinked.
    Yes, to the full image. That the link goes to `full-image.php` is because you full image to proteced. Otherwise it would just be linked directly. So just disabling that option as I suggested would have been the first to try. Why it exactly didn't work on your site, I sadly cannot answer.
  • OK. Many thanks for your help. It's appreciated.
Sign In or Register to comment.