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
In the Places album, images 3 & 4 don't show.
In the Musicians album, the last 2 images don't show.
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.
Incidentally I tried uploading one of these images to a previous version of this site on a different host. The image displays OK there.
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.
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.
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)
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.
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?
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"
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.
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.
I fear I have no idea what might be going on on your server.
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.