hi, here is a first try as providing custom storage location for imagecache.

the patch attached enables you to get files/images/cache/[preset]/images/woot.jpg<code> urls instead of <code>files/imagecache/[preset]/images/woot.jpg

why ? because i like it like that baby

feel free to review, comment, whatever

cheers, g.

Comments

guardian’s picture

Status: Active » Needs review
guardian’s picture

by the way, the patch has been generated from CVS, DRUPAL-5--2 branch

guardian’s picture

StatusFileSize
new3.23 KB

fixing indentation

dopry’s picture

Status: Needs review » Needs work

the patch looks pretty good at a glance. It needs additions to the requirements to verify the path is writable. Also as validation for the imagecache path settings form input. I'd prefer to see an element validator.

guardian’s picture

StatusFileSize
new5.64 KB

ok here is another try

i just discovered about hook_requirements, this new patch does:

  • in imagecache.install
    • change the path checked at the runtime phase
    • delete the imagecache_directory_path variable at uninstall
  • in imagecache.module
    • replaced '#after_build' => array('system_check_directory') by a validate function
    • fixed paths for 403 and 404 images
guardian’s picture

StatusFileSize
new4.74 KB

new patch taking http://drupal.org/node/66763 into account

now, the custom directory for image derivatives has to lie in side drupal's files/ directory which has a proper .htaccess file

guardian’s picture

StatusFileSize
new4.76 KB

sorry i uploaded the wrong patch
this one should be correct

guardian’s picture

Status: Needs work » Needs review
dopry’s picture

I'll have to look, but I think that .htaccess file that prevents Apache multi type exploits doesn't apply to imagecache generated derivatives... since we know they're images... so we can technically move imagecache anywhere... including /imagecache or /images when I'm working on 2.1 we'll figure this one out.

guardian’s picture

does it delay the patch until 2.1 or only allowing the derivatives to be outside the files directory ?

dopry’s picture

yes. I'm not doing any more feature additions for 2.0.

guardian’s picture

StatusFileSize
new4.79 KB

updated patch to current head, please consider it while it applies

cheers

headkit’s picture

i tried the latest of your patches from that link and i can change the path of imagecache now. thats nice and it creates the imagecache folder outside the installationpath of drupal, but it does not create a preset-folder and no image file.

please help,
thnx!!!

headkit’s picture

nothing?

drewish’s picture

Status: Needs review » Needs work

no longer applies to head.

guardian’s picture

Version: 6.x-2.x-dev » 5.x-2.x-dev

which doesn't surprise me since it was a 5.x patch and now HEAD is 6.x

when I synced the patch with HEAD it was still 5.x (http://drupal.org/node/251597#comment-866944) - I asked dopry if he could have a quick look but he answered he had no time to do so and that asking would not help

I'm sorry, I don't run D6 yet

I also switched the version to 5.x-2.x-dev since the patch originally came from CVS, DRUPAL-5--2 branch

psicomante’s picture

good patch, will it apply to 5.x?

fizk’s picture

Status: Needs work » Closed (won't fix)