|
|
(11 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| <noinclude>{{RECOUP_header|User:Bjoern/sandpit}}</noinclude>= Basic file size= | | <noinclude>{{RECOUP_header|User:Bjoern/sandpit}}</noinclude> |
| | | See http://www.ict4e.net/wiki/Mediawiki_file_size for up to date information. --[[RECOUP/site/User/Bjoern|Bjoern]] 17:52, 14 September 2008 (UTC) |
| <nowiki>{{#filesize:Image:Ground_rules.jpg}}</nowiki>
| |
| | |
| gives the filesize of that image, which is {{#filesize:Image:Ground_rules.jpg}}
| |
| | |
| <nowiki>{{#filesize:Media:Sample Household Consensus Form.doc}}</nowiki>
| |
| | |
| gives the filesize of that document, which is {{#filesize:Media:Sample Household Consensus Form.doc}}. The same with 'Image' in stead of 'Media' also works: {{#filesize:Image:Sample Household Consensus Form.doc}}
| |
| | |
| = Get file size for thumbnail =
| |
| | |
| <nowiki>{{#filesize:Image:Ground_rules.jpg|50}}</nowiki>
| |
| | |
| constrains the image to width 50px. The size is {{#filesize:Image:Ground_rules.jpg|50}} for this thumbnail: {{#filesize:Image:Ground_rules.jpg|50|linkthumb}}
| |
| | |
| <nowiki>{{#filesize:Image:Ground_rules.jpg|50x30}}</nowiki>
| |
| | |
| constrains the size to within 50x30. Size is {{#filesize:Image:Ground_rules.jpg|50x30}} for this image: {{#filesize:Image:Ground_rules.jpg|50x30|linkthumb}}
| |
| | |
| <nowiki>{{#filesize:Image:Ground_rules.jpg|10x30}}</nowiki>
| |
| | |
| constrains teh size to within 10x3. Size is {{#filesize:Image:Ground_rules.jpg|10x30}} for this image: {{#filesize:Image:Ground_rules.jpg|10x30|linkthumb}}
| |
| | |
| = Specify a size, and help =
| |
| | |
| <nowiki>{{#filesize:Image:Ground_rules.jpg|50x30|help}}</nowiki>
| |
| | |
| {{#filesize:Image:Ground_rules.jpg|50x30|help}}
| |
| | |
| = Specify a size, and provide a preview =
| |
| | |
| <nowiki>{{#filesize:Image:Ground_rules.jpg|50x100|preview}}</nowiki>
| |
| | |
| You can use the preview option to generate some information and a preview, to help choose a good image size and file size. The above command produces:
| |
| | |
| {{#filesize:Image:Ground_rules.jpg|50x60|preview}}
| |
| | |
| Note how the requested size was 50x60, and the function returns the appropriate wiki code to produce the required dimensions.
| |
| | |
| = Linking and showing the filesize =
| |
| | |
| For generic documents, Media:...pdf and Image:...pdf link to the media, and to the media page respectively:
| |
| *Direct link to media {{#filesize:Media:Sample Household Consensus Form.pdf|linkfull showparams}} (filesize relevant)
| |
| *Link to media page {{#filesize:Image:Sample Household Consensus Form.pdf|linkfull showparams}} (filesize less relevant, because it is also shown on the media page)
| |
| | |
| For images this is the same, Media:...jpg links to the (full res)image, while Image:...jpg links to the Image page.
| |
| *Link to full size image directly (useful filesize): {{#filesize:Media:Ground_rules.jpg|linkfull showparams}}
| |
| *Link to image page directly (less useful filesize): {{#filesize:Image:Ground_rules.jpg|linkfull showparams}}
| |
| | |
| If you specify a thumb size, we need to link out to the thumb. (Media and Image have same effect.) You can do it like this:
| |
| *{{#filesize:Media:Ground_rules.jpg|50x100|linkthumb showparams}}
| |
| *{{#filesize:Image:Ground_rules.jpg|50x100|linkthumb showparams}}
| |
| | |
| If you specify linkfull and and thumb size, this has the same effect as specifying linkthumb in the first place. (Giving the size of the thumb and linking to the full image makes no sense.) Example:
| |
| *Link to thumb directly: {{#filesize:Media:Ground_rules.jpg|50x100|linkfull showparams}}
| |
| *Link to page: {{#filesize:Image:Ground_rules.jpg|50x100|linkfull showparams}}
| |
| | |
| = Other experiments =
| |
| | |
| *{{#filesize:Media:Ground_rules.jpg|50x100|showthumb showparams}}
| |
| *{{#filesize:Image:Ground_rules.jpg|50x100|showthumb showparams}}
| |
| | |
| Output useful for api calls in mirroring script (needs further work to give proper serialised output):
| |
| *{{#filesize:Media:Ground_rules.jpg|50x100|serialised showparams}}
| |
| *{{#filesize:Image:Ground_rules.jpg|50x100|serialised showparams}}
| |
| | |
| {{fullurl:Media:Sample Household Consensus Form.pdf}}
| |
| | |
| {{localurl:Media:Sample Household Consensus Form.pdf}}
| |
| <noinclude>{{RECOUP_footer|User:Bjoern/sandpit}}</noinclude><noinclude>[[Category:RECOUP]]</noinclude> | | <noinclude>{{RECOUP_footer|User:Bjoern/sandpit}}</noinclude><noinclude>[[Category:RECOUP]]</noinclude> |