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).
Comments
Comment #1
siefca CreditAttribution: siefca commentedComment #2
siefca CreditAttribution: siefca commentedUpdated (small fix in case of empty object).
Comment #3
siefca CreditAttribution: siefca commentedNew patch.
Features:
img
attributes withcaptioned-image
class (useful with Lightbox),[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,thumb_
,thumbnail_
etc.Comment #4
kmontyThis issue partially duplicates #1937616: Notice: Undefined variable: width in _caption_filter_get_width()
Comment #5
kmontyFirst 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!
Comment #5.0
kmontyAdded description of one important change.