图片

From PZwiki
< Help:ImagesHelp:Images/zh-hans

< 索引

快速上手 导航 创建新页面 如何贡献
图片 表格 样式手册 翻译页面

本页面说明了如何上传图片到PZwiki以及编辑PZwiki时的图片语法。

存储在PZwiki服务器上的图片将File:命名空间前缀作为链接目标。

Translation icon.png
此页面/章节需要翻译。
我们鼓励编者尽其所能翻译此页面。

支持的图片媒体类型

PZwiki 支持一下文件格式:

  • .png: 便携式网络图形格式图片,包括动画PNG。这是《僵尸毁灭工程》中所有图形的首选格式,包括截图。
  • .gif: 传统图形交换格式图片,主要用于没有转换成动画PNG的旧动画。
  • .jpg.jpeg: 以标准JPEG格式压缩的图片(这种有损格式最适合照片)。
  • .webp: 由现代浏览器支持的替代图像格式(使用有损和无损数据压缩,减少文件大小) ,目前支持有限,没有用在任何地方。

上传其他文件格式,包括音频、视频或其他文件格式都是禁用的,目前无法上传。

上传文件

Uploading a new file can be done using the "Upload file" link in the sidebar under "Tools". Alternatively, following a red broken link or typing the link directly into the URL address bar will present the upload file page with the destination filename already filled out.

Before uploading any file, the images category should be checked first in case the desired image has already been uploaded by another user.

上传文件页面

On the upload file page, there are 2 fields that must be filled out, while the others may be left as they are.

源文件

Clicking the "Choose file"/"Browse…" button, next to the "Source file" will allow you to locate the file on your computer, which will be uploaded to the wiki.

Be sure that the file type is one of the suppоrted media types and doesn't exceed the file size limit of 32 MB.

文件描述

The "Destination filename:" field is the link to reach the file and its file description page, excluding the File: prefix. This will already be filled out if a link has been followed directly. This should be changed to something descriptive and unique to the file itself.

Refer to the style guide for the most up-to-date wiki standards when it comes to the right name.

A few example filenames are below:

图片 目标文件名
PlushSpiffo.png PlushSpiffo.png
Container Oven.png Container_Oven.png
Poster.jpg Poster.jpg
IndustrialFridge Large.gif IndustrialFridge_Large.gif

The "Summary:" is an optional field, which as the title suggests, should be used to give a summary of the file being uploaded. Anything written in the summary field will also be displayed on the file description page, therefore including a category in the summary, will include the image/page in that category. Adding the new images to a proper category may help other users to find and use your image.

The "Licensing:" field is currently left blank, however if any special licensing is applicable to an uploaded file, then any details should be included within the file description page or in the summary field.

上传选项

The "Watch this file" checkbox is ticked by default, leaving this will add the file to the user's watchlist.

Ticking the "Ignore any warnings" checkbox will skip any warnings from being displayed upon uploading the file. This is rarely used by regular users and should be left unchecked.

渲染单个图片

语法

The full syntax for displaying an image is:

[[File:Filename.extension|options|caption]]

where options can be zero or more of the following, separated by pipes |:

  • Format option: one of border and/or frameless, frame, thumb (or thumbnail).
    • Controls how the rendered image is formatted and embedded in the rest of the page.
  • Resizing option: one of:
    • {width}px — Resizes the image to fit within the given maximum width in pixels, without restricting its height.
    • x{height}px — Resizes the image to fit within the given maximum height in pixels, without restricting its width.
    • {width}x{height}px — Resizes the image to fit within the given width and height in pixels.
    • upright — Resizes an image to fit within reasonable dimensions, according to user preferences (suitable for images whose height is larger than width).
Note that the image will always retain its aspect ratio, and can only be reduced (not increased) in size unless it's in a scalable media type (bitmap images cannot be scaled up).
The default maximum size depends on the format and the internal image dimensions (according to its media type).
  • Horizontal alignment option: one of left, right, center, none.
    • Controls the horizontal alignment (and inline/block or floating styles) of the image within a text (no default value).
  • Vertical alignment option: one of baseline, sub, super, top, text-top, middle, bottom, text-bottom.
    • Controls the vertical alignment of a non-floating inline image with the text before or after the image, and in the same block (the default vertical alignment is middle).
  • Link option: one of:
    • link={target} — allows to change the target (to an arbitrary page title, or URL) of the generated link, activatable on the rendered image surface; e.g., [[File:Image.png|20px|link=https://projectzomboid.com/]] renders as Image.png (external link), or [[File:Image.png|20px|link=Main Page]] renders as Image.png (internal link).
    • link= (with an empty value) — displays an image without any activatable link; e.g., [[File:Image.png|20px|link=]] renders as Image.png.
      • If you set |link=| (empty), then no title will be rendered.

By default an image links to its file description page. The "link=" option modifies this behavior to link to another page or website, or to turn off the image's linking behavior.

格式

The most common formats used within the PZwiki are the frame and thumb or thumbnail formats, as these are rendered as floating blocks, allowing text to wrap around them, along with the possibility of a caption.

When the height of an image in thumbnail is bigger than its width (i.e., in portrait orientation rather than landscape) and you find it too large, you may try the option upright=N, where N is the image's aspect ratio (its width divided by its height, defaulting to 0.75). The alternative is to specify the desired maximum height (in pixels) explicitly.

Note that by writing thumb={filename}, you can use a different image for the thumbnail.

链接到图片

Add : as a prefix to the link you need to create.

[[:File:Image.png]]

File:Image.png

[[:File:Image.png|Description]]

Description

适应浏览器宽度的一行图片

One way that works for a row of images with varying widths is not to use "thumb" or "left" or "none". If "thumb" is not used (and thus no captions) a row of images will wrap to the browser width. If necessary, narrow the browser window to see the images wrap to the next row.

[[File:Image.png|220px]]
[[File:Image.png|100px]]
[[File:Image.png|150px]]
[[File:Image.png|250px]]
[[File:Image.png|200px]]
[[File:Image.png|50px]]
[[File:Image.png|220px]]
[[File:Image.png|175px]]

Image.png Image.png Image.png Image.png Image.png Image.png Image.png Image.png

To wrap images of varying widths with captions it is necessary to use div HTML for an unordered list. Along with style="display: inline-block;".

<div><ul>
<li style="display: inline-block;">[[File:Image.png|thumb|none|220px|Caption 1]]</li>
<li style="display: inline-block;">[[File:Image.png|thumb|none|100px|Caption 2]]</li>
<li style="display: inline-block;">[[File:Image.png|thumb|none|150px|Caption 3]]</li>
<li style="display: inline-block;">[[File:Image.png|thumb|none|250px|Caption 4]]</li>
<li style="display: inline-block;">[[File:Image.png|thumb|none|200px|Caption 5]]</li>
<li style="display: inline-block;">[[File:Image.png|thumb|none|50px|Caption 6]]</li>
<li style="display: inline-block;">[[File:Image.png|thumb|none|220px|Caption 7]]</li>
<li style="display: inline-block;">[[File:Image.png|thumb|none|175px|Caption 8]]</li>
</ul></div>
  • Caption 1
  • Caption 2
  • Caption 3
  • Caption 4
  • Caption 5
  • Caption 6
  • Caption 7
  • Caption 8

wiki中的文件列表

外部链接