While using the "Image Resize Filter" with a private filesystem, the appropriate resized files are created in the right places in the private filesystem. However, upon attempting to access those files, I get a Drupal error "Page not found". The URL is accurate and I can see the file in the filesystem where it should have been found by Drupal.

The URL is of the form http://www.myserver.com/system/files/resize/myphoto-100x100.jpeg for a resized image of size 100x100 and the location in the filesystem was /myprivatefiles/resize/myphoto-100x100.jpeg.

Upon investigating this further, I think I found a bug in the image resize module code. A trivial one, no doubt. But it caused me to lose quite a bit of time chasing down various other module upgrades to find the problem. Hopefully, this will help others in the same boat. Otherwise, thanks to the author for a useful module.

Attaching the patch for review and incorporation. Many thanks to the Drupal community. I'm a recent member of the community and find it to be a great CMS toolset.

--Eko

Comments

quicksketch’s picture

Status: Active » Needs review

Wow, yeah this looks like a simple typo. Moving to needs reviews so I'll test it next time I'm looking at Image Resize Filter. The patch looks great, but as a reminder make sure to use the "unified" format when creating patches with the "-u" flag.

quicksketch’s picture

Status: Needs review » Fixed
StatusFileSize
new881 bytes

I revised your patch slightly and just moved the dot outside the parenthesis so that we don't need to include it for each extension. Committed. Thanks for the report and patch!

Status: Fixed » Closed (fixed)

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

tsokura’s picture

Status: Closed (fixed) » Active

Moving the dot outside the parenthesis changes the patch, it's not semantically the same anymore without further changes to the code. See the $matches[] references after the modified line in the patch and you'll see what I mean.

Anyway the original patch by ekoaham worked for me too, for displaying resized files when using the private download method. The revised patch by quicksketch didn't work, so I'm setting this issue to active again. Could we also get a new release of the module with the patch included, it's really a showstopper for those of us using the private download method. Thanks.

quicksketch’s picture

Version: » 6.x-1.6
Status: Active » Needs work

Oh dear, you're correct, because then the "." gets dropped and isn't included in the final filename when we reconstruct it. Shoot. I'll correct it next time I'm working on Image Resize Filter.

quicksketch’s picture

Priority: Critical » Normal
Status: Needs work » Fixed
StatusFileSize
new886 bytes

Fixed with the attached patch. Committed.

Status: Fixed » Closed (fixed)

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