Page MenuHomePhabricator

New parameter for file size and or image dimensions
Closed, DeclinedPublic

Description

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 ;)


Version: 1.16.x
Severity: enhancement

Details

Reference
bz19811

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:41 PM
bzimport set Reference to bz19811.
bzimport added a subscriber: Unknown Object (MLST).

I think this would be better off as a parser function, like {{#fileinfo:Foo.jpg}}

indeed. could be used more flexible.

(In reply to comment #4)

extensions exist for this.

> WORKSFORME.