Extension talk:ImageSizeInfoFunctions

Latest comment: 11 years ago by Pecoes in topic Image class

Improved usage and stability

edit

I suggest to modify the code so that

 $title = Title::makeTitle(NS_IMAGE,$image);

(which assumes that the image name is a safe database key), becomes:

 $title = Title::newFromText($image,NS_IMAGE);

(which supports non-normalized image names and image names already with a "File:" namespace prefix)

Based on this change, a new template can be created which largely mirrors the normal way of embedding images, mirroring all (or most?) functionality. See Extension talk:ImageSizeInfoFunctions/Template:Image for example code. --G.Hagedorn 00:03, 16 December 2008 (UTC)Reply


It sounds right. Thanks for your suggestions, I'll test them as soon as possible on my wiki. --GB 20:44, 4 January 2009 (UTC)Reply

Advise?

edit

This extension seems to be very close to what I need, but the design is a bit over my head.

Can such thing be done with this extension: have a css frame (div) of 30% width, with internal margins measured in pixels/points, and inside the frame, an image "using all the width available to it". Alternatively, only an image with 100% width of the containing frame (div)? Ditto with the table containing an image?

Or ought it be developed further to do this? Thanks. Yury Tarasievich 13:38, 4 March 2009 (UTC)Reply

mmm... I'm not sure I understood... basically, with this extension, you can "ask for" the image pixel size. Then you can use such information in a template or a report. This extension was created in order to have a template for resizing the image based on percentage instead of pixel. As example, take a look at this page: these heraldry shields are all in the same scale, but with different size due to different crowns. In this case the resizing by normal Image wiki syntax gives a wrong results because it works only with absolute size, thus we developed the ImageSizeInfoFunctions extension and an ad hoc template --GB 09:01, 20 April 2009 (UTC)Reply

Thank you

edit

In combination with ParserFunctions and SecureHTML you can create square thumbs (divs with backround-image). This could be done without SecureHTML but MW blocks "background-image" in HTML input. --Subfader (talk) 16:44, 7 April 2012 (UTC)Reply

Image class

edit

I'm the furthest thing from a mediaWiki expert, so forgive me if this is a stupid question, but what's the deal with that Image class? I can't seem to find any docs for it. Does it even exist in current versions of mediaWiki? If not, shouldn't this:

$file = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new Image( $title );

be replaced with this?

$file = wfFindFile( $title );

And why wouldn't wfFindFile exist anyway? Pecoes (talk) 06:44, 18 May 2013 (UTC)Reply

Return to "ImageSizeInfoFunctions" page.