Any chance this module will support imagecache?

Thanks.

Comments

deciphered’s picture

Hi 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.

ManyNancy’s picture

Thank you so much. I'm looking forward to this. :)

sadist’s picture

subscribe! ;D

esclapes’s picture

subscribe

NoDice’s picture

Suscribe.

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.

deciphered’s picture

@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.

NoDice’s picture

Ahhh okay thanks for the clarification Deciphered. :)

adrien.felipe’s picture

I guess "subscribe" means "looking forward to it", so I do subscribe.

It would be a big step, thx in advance!

mark.’s picture

Subscribing.

deciphered’s picture

Status: Active » Needs work
StatusFileSize
new4 KB

Hi 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.

adrien.felipe’s picture

I must say, thank you very much for this.

I'm testing it right away and I'll do a feedback

adrien.felipe’s picture

First 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

adrien.felipe’s picture

I 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.

benone’s picture

+1 :)

3dloco’s picture

+1 :-D

gilcpd’s picture

subscribing

locomo’s picture

subscribe

sdsheridan’s picture

This would definitely be useful!

finex’s picture

subscribing :-)

mikepetersonwi’s picture

subscribing :-)

arthur_drupal’s picture

I 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.

cancerian7’s picture

subscribing :-)

pawel_r’s picture

Also subscribing.

krueschi’s picture

subcribing :-)

sammo’s picture

This 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:

if(strpos(&$node->content[$file['name']]['field']['items'][$count[$file['name']] - 1]['#theme'], 'imagecache') !== FALSE) {$target['filepath'] = $target['origpath'];}
benone’s picture

sammo I tried your fix, but no changes, the path is still the same.

akalam’s picture

StatusFileSize
new3.12 KB

My 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

greatfield’s picture

Hi 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.

deciphered’s picture

Hi 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.

neRok’s picture

Any progress Deciphered?

Matthew Kivett’s picture

Could 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!

deciphered’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

The Drupal 6 version of this module will not be receiving any more support.