Last modified: 2012-12-19 15:21:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21811, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19811 - New parameter for file size and or image dimensions
New parameter for file size and or image dimensions
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.16.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-18 15:35 UTC by Subfader
Modified: 2012-12-19 15:21 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Subfader 2009-07-18 15:35:16 UTC
I'd like to request a new parameter for image and gallery tags to display the file's file size and dimensions for images. Let's call it "fileinfo".

<pre>[[File:Example.jpg|300px|thumb|fileinfo]]</pre>
This would return e.g. "400×300 (24 KB)" in the thumb.

<pre>[[File:Example.jpg|300px|thumb|Bla - |fileinfo]]</pre>
This would return e.g. "Bla - 400×300 (24 KB)" in the thumb.

<pre><gallery perrow="3" fileinfo="true">
File:Example1.jpg|Bla 1
File:Example2.jpg|Bla 2 - 
File:Example3.jpg|Bla 3<br>
File:Example4.jpg|
File:Example.ogg|Bla x
File:Example.pdf|Bla y
</gallery></pre>
This would would return a gallery with the file info behind the file's caption, e.g. "Bla 2 - 400×300 (24 KB)" or "Bla 3
400×300 (24 KB)".
If you decide to add the fileinfo in green as on search results a seperator may not be urgely needed as in the example above.

May be smart to also allow file info in galleries per file:
<pre><gallery perrow="3">
File:Example1.jpg|Bla 1|fileinfo
File:Example2.jpg|Bla 2|fileinfo
File:Example3.jpg|Bla 3|fileinfo
File:Example4.jpg|Bla 4|fileinfo
File:Example.ogg|Bla x
File:Example.pdf|Bla y
</gallery></pre>
This would return the file info behind the only behind the 4 image captions.

I wonder why Commons didn't request it yet or created an own solution. It seems so handy to me.

I changed getShortDesc() in Generic.php so it displays KB instead of bytes which is pretty useless for files btw ;)
Comment 1 Roan Kattouw 2009-07-25 14:23:34 UTC
I think this would be better off as a parser function, like {{#fileinfo:Foo.jpg}}
Comment 2 Subfader 2009-07-25 14:44:10 UTC
indeed. could be used more flexible.
Comment 3 Subfader 2012-04-07 13:57:43 UTC
For the interested ones: http://www.mediawiki.org/wiki/Extension:ImageSizeInfoFunctions
Comment 4 Subfader 2012-07-20 11:42:45 UTC
extensions exist for this.
Comment 5 Andre Klapper 2012-12-19 15:21:11 UTC
(In reply to comment #4)
> extensions exist for this.

=> WORKSFORME.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links