Closed (won't fix)
Project:
File Aliases
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Jan 2010 at 09:26 UTC
Updated:
2 Nov 2015 at 23:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
decipheredHi Minqensan,
Originally when I saw this issue last night I would have said it's unlikely due to the nature of ImageCache, but between that time and now I have had some time to ponder the possibilities and I think it is quite likely that I could put something together that will work.
Will let you know how it goes.
Cheers,
Deciphered.
Comment #2
ManyNancy commentedThank you so much. I'm looking forward to this. :)
Comment #3
sadist commentedsubscribe! ;D
Comment #4
esclapes commentedsubscribe
Comment #5
NoDice commentedSuscribe.
This would be great because you can't change the base path nor create custom file path aliases per preset with ImageCache module. So you end up having related images saved in different directories which to me isn't very intuitive or organized. They talk about this issue on ImageCache at following links: http://drupal.org/node/469244, http://drupal.org/node/160292, http://drupal.org/node/82780 **ImageCache says they won't include feature to change paths**
For example, this is an example of what's happening now using Image and ImageCache:
ImageCache "thumbnail" preset save location:
/sites/default/files/imagecache/thumbnail/images/john_doe-thumbnail.jpg
Images save location (assuming you use default images location):
/sites/default/files/images/john_doe.jpg
It would be ideal to have john_doe-thumbnail.jpg saved in the same directory w/ its original image.
You won't have scattered files and this will help SEO when they start indexing images too.
Comment #6
deciphered@NoDice
This wouldn't physically move the file itself, that would be something that FileField Paths or an off-shoot would be better to handle, this would simply create a File Alias to the physical file.
Basically you could have the file alias be: /node/1/images/preset/file.ext
But the file would still live in: /sites/default/files/imagecache/preset/node/1/file.ext
However, with that said, it should still have the same SEO benefits.
As for an update on this request, I did attempt it going down one path, but I wasn't happy with the implementation and have decided to approach it from another angle, but have yet to try the new approach.
Clearly this is a popular request and I will implement it as soon as I am happy with it.
Cheers,
Deciphered.
Comment #7
NoDice commentedAhhh okay thanks for the clarification Deciphered. :)
Comment #8
adrien.felipe commentedI guess "subscribe" means "looking forward to it", so I do subscribe.
It would be a big step, thx in advance!
Comment #9
mark. commentedSubscribing.
Comment #10
decipheredHi guys,
I've attached a somewhat working version, but I will note that this is not even ready to be committed so DO NOT USE this unless you wish to help test the functionality on development site.
To test it you need to save the file to 'file_aliases/modules/imagecache.inc'.
Insert anyone of the following tokens into the File Alias path:
[imagecache-dot] (preset.)
[imagecache-slash] (preset/)
[imagecache-underscore-pre] (_preset)
[imagecache-underscore-post] (preset_)
Paths similar to '/site/default/files/imagecache/preset/file.ext' in your node body or text cck fields will be converted automatically.
It isn't perfect yet, but it does somewhat work.
Feedback appreciated.
Cheers,
Deciphered.
Comment #11
adrien.felipe commentedI must say, thank you very much for this.
I'm testing it right away and I'll do a feedback
Comment #12
adrien.felipe commentedFirst feedback :
I had a :
warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/vhosts/picsell.fr/httpdocs/dev/sites/default/modules/file_aliases/modules/imagecache.inc on line 41.
Solved forcing the type :
(array)$form['#submit'] on line 41
Comment #13
adrien.felipe commentedI guess this only works with an image linked to a node.
It's a good start, but think that ubercart an other modules use imageCache out of nodes. Like product list, or whatever.
I was wondering adding this at a preset level, admin/build/imagecache/#
or maybe use pathauto and a fieldset for files in admin/build/path/pathauto
What do you think?
Anyway, thanks for your generous work.
Comment #14
benone commented+1 :)
Comment #15
3dloco commented+1 :-D
Comment #16
gilcpd commentedsubscribing
Comment #17
locomo commentedsubscribe
Comment #18
sdsheridanThis would definitely be useful!
Comment #19
finex commentedsubscribing :-)
Comment #20
mikepetersonwi commentedsubscribing :-)
Comment #21
arthur_drupal commentedI am french so i am not sure to understand your problem but i had a problem with file aliases and imagecache, they didn't worked together!
My problem was that I had a preset 'thumb' and I used imagelink with imagefield but my image didn't display !
After research, here is my solution, maybe it can help :
I change this line in imagecache.module line 713 (corresponding to my formatter i have choosen ie imagelink)
$imagetag = theme('imagecache', $presetname, $item['filepath'], $item['data']['alt'], $item['data']['title']);to this line :
$imagetag = theme('imagecache', $presetname, $item['origpath'], $item['data']['alt'], $item['data']['title']);and then it worked !
Good luck and sorry if yout problem is not like mine.
Comment #22
cancerian7 commentedsubscribing :-)
Comment #23
pawel_r commentedAlso subscribing.
Comment #24
krueschi commentedsubcribing :-)
Comment #25
sammo commentedThis is a cleaner fix to the file aliases module, needs to be added to the end of the file_aliases_filefield_process function in filefiled.inc:
Comment #26
benone commentedsammo I tried your fix, but no changes, the path is still the same.
Comment #27
akalam commentedMy solution (works for me, and only yet for basic img tags) is to avoid aliasing in imagecache url presets, but support them in original image paths
I worked for me in the following use case:
a imagefield, with file aliasing, and colorbox display format with thumbnail preset linked to original file. The thumbnail is with the clasic imagecache url format, but the original file support alias
Here is the patch
I hope to help
Comment #28
greatfield commentedHi desarrollo2.0
Thanks for your comment but this is not working for me. Applied your patch succesfully, the file alias option pops up in the field_image_cache of a content type. But whatever way i configure, i keep getting the original http://www.example.com/sites/default/files/imagecache/product_full/name.jpg on my product pages. Using this in conjunction with ubercart hence the imagecache.
Comment #29
decipheredHi All,
Image Styles (Imagecach for D7) support is in 7.x-1.0-beta1, so I will try to backport the approach to 6.x if I have some time.
Cheers,
Deciphered.
Comment #30
neRok commentedAny progress Deciphered?
Comment #31
Matthew Kivett commentedCould someone clarify how to utilize File Alias for image style derivatives?
I'm currently using 7.x-1.0-beta1 which Deciphered mentions above as having this support, but I can't figure out how to configure it or get it working.
Thanks!
Comment #32
decipheredThe Drupal 6 version of this module will not be receiving any more support.