On Wed, Oct 31, 2012 at 6:53 AM, Daniel Barrett <d...@vistaprint.com> wrote:

> Is there any easy way (via extension) to modify the "src" attribute of
> images on wiki pages?
>
> I see hooks for modifying href values - LinkBegin and LinkEnd.  But I
> don't see something similar for images, whose URLs seem to be produced via
> File::getUrl().
>
> Purpose: I want to add a querystring parameter onto the ends of the URLs,
> turning <img src="foo.jpg"/> into <img
> src="foo.jpg?timestamp=xxxxxxxxxxx"/> to aid with caching.
>

There's not a great hook point for this I think, but you could probably add
one in.

ThumbnailImage::toHtml() in includes/media/MediaTransformOutput.php is the
function that actually produces the <img> tag. You could probably stash
something there, or on the constructor for the class, to modify the URL.

-- brion
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to