Linking directly to images

Hi, I used to be able to link to images in this format (and I still can for older albums):
http://zenphoto.[sitename].net/[albumname]/image/[longsidelength]/IMG_7189.jpg
which I really liked as I could set the size in the URL, here is an example:
http://zenphoto.pwilkinson.net/newyork16012013/image/674/IMG_7189.jpg

Since an upgrade though this doesn't seem to work on albums that have been created since the upgrade and I get an access denied message e.g.
http://zenphoto.pwilkinson.net/california30062012/image/674/IMG_8269.jpg

I have checked various permissions on the ftp images as well as the album settings but I can't seem to find the right thing to fix it and everything I do find is already set the same for each album.

Any ideas?

Comments

  • acrylian Administrator, Developer
    It is not and was never possible to set the image size via the url that way. If you set something via the url it would hae to go through the /zp-core/i.php script. Which all image request to uncached images do.

    A link like http://zenphoto.pwilkinson.net/newyork16012013/image/674/IMG_7189.jpg
    translates to an image.php theme page of the image "IMG_7189.jpg" that is within the sub album "674" of the sub album "image" of an top level album "newyork16012013". (if mod_rewrite is enabled).

    Or if it is a full imge link it translates to an image "IMG_7189.jpg" within the sub album "674" of the top level album "image" within the "albums" folder that has been renamed to the custom name "newyork16012013".
  • Well, that's how I've always done it! No sub-albums etc as you've suggested, so it must have been possible at some point. Have you actually clicked on the new york photo link above? It takes you (by re-directing to the cache) to a copy of the picture that is 674 pixels on the long edge, which can't be a coincidence (most of my uploaded images are 1500px on the long edge).

    This link here:
    http://zenphoto.pwilkinson.net/london14022010/image/450/IMG_4075.jpg
    funnily enough takes you to a photo that is 450 pixels on the long edge too.

    What would the link structure through the /zp-core/i.php look like please?
  • acrylian Administrator, Developer
    Sorry, I am with Zenphoto since 2007 and I really don't remember that type of link ever being used or worked. If it did work it might been an unofficial way. My colleague may correct me.

    Use the image template functions available instead of i.php directly:
    http://www.zenphoto.org/documentation/functions/_template-functions.php.html
    get versions get the url, print versions print the html tag.

    Update: I stand corrected. You are indeed right, those links did once work and got lost with the mod_rewrite restructuring in 1.4.5. It is not done via hatchess directly anymore to better support servers without htaccess like nginx (which our own server uses).
  • acrylian Administrator, Developer
    So here is why: It is not allowed anymore to use these urls because of security. All image processor calls now require a special security token to avoid that someone from the outside can overload a server using loads of those calls.
  • Thanks acrylian, that makes sense, I will try and figure out a way around it!
  • acrylian Administrator, Developer
    In which context did you use these urls? Maybe we can help. Generally as said you should use the image functions avaiable (or more advanced the object model).
Sign In or Register to comment.