I'm setting up an image gallery on my site, and I'm wondering whether there is a way to get image.module to use friendly URLs for all of the image files themselves. This is important to me, firstly because friendly URLs are more comprehensible to humans and search engines, and secondly because as with all URLs, the address of an image is a contract that I do not want to break in the foreseeable future, so I'd like to use something meaningful.

Unfortunately, the randomly-generated "tmp" filenames produced by image.module are really not conducive to either of these aims. Is there a way to improve this? Ideally the image node page could supply the image itself, e.g. if the image node is /node/101 then it could supply the actual image file on /node/101/small.jpg, /node/101/preview.jpg etc using private file downloading. Aliasing the image node would, however, become harder.

Also, I'd like to improve the image scaling quality, as it's pretty poor at the moment. Is there a way to do this?

Comments

mhutch’s picture

I fixed the scaling using http://drupal.org/node/29528, though getting imagemagick to work took a while. I'm very surprised that image.module's issue queue is as full as it is. It even has year-and-a-half old patches in it -- surely patches should be either accepted or rejected before they get stale.

mhutch’s picture

I finally discovered /image/view/101/preview style URLs. Fortunately these have a nice predictable format, and I can alias them if I need to. However, I can't find a way to use these addresses by default in the image node pages.

If anyone else wants to do this, I have achieved it by hacking image.module. I changed the last line of function image_display to
return theme('image_display', $node, $label,'/image/view/'.$node->nid.'/'.$label, $attributes);