I have an override theme_image function in my template.php and it doesn't appear to affect resized images but it does work for other images.

Comments

quicksketch’s picture

The Resize Image Filter does not currently run through theme_image() or any theme functions at all, though that's an interesting possibility. All that Image Resize Filter does is read the height/width attributes, create an image to match it, then update the SRC attribute. Though now it's doing things like adding links and such, it might make sense to pass it through the theme layer also. Right now it's not though, so there's no way you can affect its output.

quicksketch’s picture

Title: Image_resize_filter overrides or does not get passed through theme_image » Make Image Resize Filter images run through a theme function
Category: support » feature
Status: Active » Needs review
StatusFileSize
new11.27 KB
new11.44 KB

I've been thinking about this issue for a while now and decided to take a look at the possibility. It does open up some very interesting uses if you're able to run <img> tags through the theme layer. You can do things like read out the "title" attribute and display it as a caption, or wrap your tags in divs or add your own classes. Generally a lot of useful possibilities here. Here are patches for D6 and D7.

quicksketch’s picture

Status: Needs review » Fixed
StatusFileSize
new11.54 KB
new13.3 KB

Alright, a few further tweaks and I've committed this version of the patch. This patch makes the change that all images are run through theme_image_resize_filter_image(), even if they don't have their original size changed (however the output should be identical before and after with the default theming). This allows for special theming of all inline images, such as taking the "title" attribute and printing it as a caption.

I expect this may need a little further tweaking before a new release of the module, but this is a good start on potentially very useful change.

Status: Fixed » Closed (fixed)

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