Hi,

I am using Image Resize Filter with IMCE and FCKeditor, and some crazy directories are being created when I upload. I uploaded and resized a photo into a test blog entry, and this the message it gave me:

Blog entry My first blog entry has been updated.
The directory sites/default/files/resize has been created.
The directory sites/default/files/resize/sites has been created.
The directory sites/default/files/resize/sites/default has been created.
The directory sites/default/files/resize/sites/default/files has been created.
The directory sites/default/files/resize/sites/default/files/u5 has been created.

I created another user and uploaded a photo to his blog (it's a multi-user blog site), without resizing the image. It didn't announce the creation of any directories (though a directory was created for the user at sites/default/files/u6).

To confirm that the problem is with Image Resize Filter, I created a third blogger and uploaded and resized an image, and got this message:

Blog entry Trying with a new user has been created.
The directory sites/default/files/resize/sites/default/files/u7 has been created.

I don't think the problem is with my Drupal/IMCE file upload settings, but you be the judge:

admin/settings/file-system --> sites/default/files

admin/settings/imce/profile/edit/3 --> u%uid

admin/settings/fckeditor/edit/[profile]
path to uploaded files --> %b%f/u%u
absolute path to uploaded files --> %d%b%f/u%u

Have I done something wrong? Ideally I'd like the resized images to land in sites/default/files/uUID/resize/

Thanks,
Andrea

Comments

quicksketch’s picture

Category: bug » feature

I've been thinking about this in my recent ImageCache reviews, where it uses a similar mechanism. Duplicating the files directory makes it so that we can resize any image on the entire website, including those not in the files directory. I'll considering moving this location so that it strips out the second files directory, effectly making this module only work on local files within the files directory.

After this change, the path will be sites/default/files/resize/uUID/ in your situation, since all the resized images are stored in a single directory managed by this module.

citronica’s picture

That would be great!

quicksketch’s picture

Status: Active » Fixed

Well this was much easier than I expected. And it still works with images outside the files directory! Seems like an easy win. I'll make a 1.1 release with the fix shortly.

citronica’s picture

Looks good in most respects, though it seems to have an extra slash somewhere:

* The directory sites/default/files/resize//u7 has been created.
* The directory sites/default/files/resize//u6 has been created.
* The directory sites/default/files/resize//u5 has been created.

It created the directory in the right place, and the resized images landed there correctly. But when I deleted the node, it did not delete the resized image.

quicksketch’s picture

Thanks, I've see the extra slash issue also. Let's open new issues for these problems.

quicksketch’s picture

Title: resized image path is unnecessarily long and repetitive » Shorten the Unnecessarily Long and Repetitive Path

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.