Hi,

I've created a patch that fixes the bugs:

- warnings during calculating sizes of local images,
- inability to caption images added with Insert.

For size calculation it uses urldecode to change URL-encoded characters from src attribute into acceptable by filesystem and uses internal Drupal functions to make local paths public or private URLs instead of distinguishing between local and remote resources – it just makes everything URL-s, but in case of local files these are public:// or private:// -style URL-s (depends on site configuration).

For Insert-compatibility I've included changes proposed by Arshad Chummun (see http://drupal.org/node/1666792).

Besides that I've added couple of things:

- mangling img tag by adding captioned-image class – helpful in combination with lightbox2 and similar,
- automatic copying caption from title attribute of img tag if it exists and the given caption is empty,
- automatic linking to the original version (sensitive to large_, big_, medium_, small_, thumb_, thumbnail_ prefixes).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

siefca’s picture

siefca’s picture

Updated (small fix in case of empty object).

siefca’s picture

New patch.

Features:

  • fixed the cause of warnings during calculating sizes of local images,
  • added ability to caption images added with Insert,
  • added decorating img attributes with captioned-image class (useful with Lightbox),
  • added automatic size calculation for public and private images,
  • added explicite and automatic linking:
    • [caption link="1"] or [caption link="true"] causes automatic linking to original image;
    • [caption link="some_link"] causes captioned object to link to a given resource,
  • added support for image styles (Drupal 7) – when automatic linking is in use the original image path is determined using proper functions,
  • added support for popular IMCE generated image versions – when automatic linking is in use the original image filename is determined by cutting off common prefixes like thumb_, thumbnail_ etc.
kmonty’s picture

kmonty’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Needs review » Closed (won't fix)

First off, I'd like to thank you for putting forth the time + effort into patching up Caption Filter!

However, I am reluctant to consider it. It's a Drupal community standard to break apart each issue into its own issue and patch, to make it easier for the community + maintainers to consider the code, bug, and fix. With so many issues in one patch, it's difficult for me to make a quick judgment and go from there--especially for new features (that aren't bug fixes), such as the linking functionality you developed (.

Plus, many of these issues that you discuss have been fixed in other issues, using patches that were submitted with their queues.

There's clearly some good stuff here, but many of the issues + features merit further discussion and development, and tackling all that in one thread would be messy. So, if you feel that some of these bugs + feature requests are important, please break them out into separate tickets so we can discuss and go from there.

Thank you!

kmonty’s picture

Issue summary: View changes

Added description of one important change.