Gallery: 图片尺寸设定:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
 
(未显示同一用户的2个中间版本)
第28行: 第28行:
* 如果需要的话,你可以为每个相册设置'''不同的缩略图和重设图片尺寸'''。只要浏览一个相册并点击''编辑相册(Edit Album)''就可以了。
* 如果需要的话,你可以为每个相册设置'''不同的缩略图和重设图片尺寸'''。只要浏览一个相册并点击''编辑相册(Edit Album)''就可以了。
* 在G2中,你的图片'''没有上采样过程(upsampling)''',即,如果重设的尺寸比原图片大的话,就不会进行此创建动作。而缩略图的尺寸如果大于原始图片的尺寸的话,原始图片就会被当作缩略图使用。
* 在G2中,你的图片'''没有上采样过程(upsampling)''',即,如果重设的尺寸比原图片大的话,就不会进行此创建动作。而缩略图的尺寸如果大于原始图片的尺寸的话,原始图片就会被当作缩略图使用。
* '''新建相册的设定'''继承父族相册的设定。因此,如果你希望新建的顶层相册具有期望中缩略图和重设图片尺寸的话,就需要在[[Gallery:Root_Album|根目录相册]]中设置尺寸。
* '''新建相册的设定'''继承父族相册的设定。因此,如果你希望新建的顶层相册含有满意的缩略图和重设图片尺寸,就需要在[[Gallery:Root_Album|根目录相册]]中设置尺寸。


=== Thumbnail Size ===
=== 缩略图尺寸 ===
* You can set the maximal size in pixels for thumbnails.
* 你可以为缩略图按像素设置最大尺寸。


The [http://en.wikipedia.org/wiki/Aspect_ratio_(image) aspect ratio] of the generated thumbnail will be the same as the one of the original full-size image. If your original image has the ratio  4:3 of width to height and you chose 160 as the thumbnail size, then your thumbnail will have the dimensions 160 pixel in width and 120 pixel in height.
生成的缩略图[http://en.wikipedia.org/wiki/Aspect_ratio_(image) 图像高宽比]会与某原始尺寸图片相同。如果原始图片的宽比高是4:3而你选择的缩略图尺寸为160,那么缩略图就会变成宽×高=160像素×120像素。


If the [[Gallery:Modules:squarethumb|squarethumb module]] is active, all thumbnails will be generated with square dimensions, that is their width is the same as their height, independently of the aspect ratio of the original.
如果[[Gallery:Modules:squarethumb|squarethum模块]]为活动的话,那所有缩略图都会生成为方形尺寸规格,即宽与高相同,并且不受原始图片高宽比的限制。


Notes:
注:
* You can '''set a cropped thumbnail manually for each photo''' by browsing to a photo and clicking on ''Edit Photo'' and then on the ''Crop Thumbnail'' tab.
* 你可以'''对每张照片的缩略图进行裁剪'''。你所要做的就是打开一张相片,点击''编辑相片(Edit Photo)''接着点击标签''裁剪缩略图(Crop Thumbnail)''
* You can upload an unrelated / specific image as thumbnail for any item. Activate the [[Gallery:Modules:thumbnail|thumbnail module]] and browse to the album / photo and click on ''Edit Album'' / ''Edit Photo'' and then on the ''General'' tab to use the custom thumbnail upload option at the bottom of the page.
* 你为任何项目可以上传一个不相关/特殊的图片。激活[[Gallery:Modules:thumbnail|thumbnai模块]],浏览到相册/相片,然后点击''编辑相册(Edit Album)''/''编辑相片(Edit Photo)'',最后点击标签''一般(General)''就可以使用页面底部的自定义缩略图选项了。
* Thumbnails for albums are called '''highlight''' or ''album highlight'' since this single thumbnail represents all photos of this album.
* 相册的缩略图被称为'''封面(highlight)'''''相册封面(album highlight)'',因为这单独的一张缩略图代表了该相册中所有的照片。
* G2 picks the first image that was added to an album as the album highlight. You can change the album highlight by browsing to a photo of the album and clicking ''Make Highlight''.
* G2选取一个相册中第一个被添加的图片作为相册封面。你可以打开某张相片点击''作为封面(Make Highlight)''来改变相册封面。
* If you want that the thumbnail for an album changes randomly to showcase all the photos of the album as album highlight, activate the [[Gallery:Modules:randomhighlight|randomhighlight module]] for that album.
* 如果你希望相册随机抽取其中的某张相片作为封面以展示所有照片的话,请激活该相册的[[Gallery:Modules:randomhighlight|randomhighligh模块]]


=== Resize Size ===
=== 重新设定尺寸 ===
* You can set the maximal dimensions in pixels for each resize. The [ ] x [ ] input fields are for width (left box) and height (right box) of the resize.
* 你可以为每个重设尺寸的图片设置最大像素尺寸。[ ] x [ ]中左边括号内填入的应该是重设尺寸图片的宽度,右边的则是高度。
* You can set an arbitrary number of intermediate sized images by entering dimensions.
* 通过输入尺寸规格,你可以为中间尺寸图片设置任意数字。
* You can set the priority / order of the resizes. The resize dimensions at the top of the list are shown as the default resize etc. The order in which you list the dimensions in edit album -> 'album' is the order in which the resize versions are listed in the resize list shown of on each photo page.
* 你可以设置重设图片的优先级/次序。列表顶部的重设图片尺寸则被作为默认的重设尺寸。每个相册在edit album -> 'album'中设置的尺寸排序即相片页面中重设图片版式的排列顺序。


The [http://en.wikipedia.org/wiki/Aspect_ratio_(image) aspect ratio] of the generated thumbnail will be the same as the one of the original full-size image. The dimensions you enter for the resize version are maximums in pixels for the width and the height.
生成的缩略图[http://en.wikipedia.org/wiki/Aspect_ratio_(image) 图片高宽比]与原始尺寸的图片相同。你所输入的重设图片版式是宽与高的最大像素。


Notes:
注:
* '''Different resize sizes for each photo''' in an album are also possible. Browse to a photo and click ''Edit Photo'' and then on the ''Photo'' tab.
* 相册中'''每张相片具有各自的重设尺寸'''也是可以的。你所要做的就是,打开一张相片点击''编辑相片(Edit Photo)'',然后再点击标签''相片(Photo)''


=== Full-Size Size ===
=== 全尺寸 ===
The dimensions of the original full-size image are unchanged unless you explicitly change them. If you deal with 8 MegaPixel images from your latest digital camera, you might want to resize (down size/down sample) the images before you upload them to G2 to save bandwidth and webspace.
原始的全尺寸图片规格是不变的,除非你特别进行修改。如果要处理最新的800万像素数码相片的话,你可能需要在上传到G2之前重设(缩小尺寸/缩小样本尺寸)图片,这样做的目的就是减少带宽消耗和节省网站空间。


Notes:
注:
* Gallery Remote can resize the images on upload for you
* Gallery Remote可以为你重设上传图片
* G2 can resize your original files automatically for you when you add them if the [[Gallery:Modules:sizelimit|sizelimit module]] is active and a sizelimit is defined for the album in ''Edit Album'' in the ''Album'' tab. The original file will be resized and and the resized version will be stored as the new original and the old original will be deleted.
* [[Gallery:Modules:sizelimit|sizelimit模块]]激活并且相册的尺寸限制(sizelimit)有定义(标签''Album''下的''Edit Album'')的话,当执行原始文件添加时,G2可自动为你完成该操作。这样原始文件就会被重设尺寸而重设尺寸的版式将会作为新的保存下来,而先前的则会被删除。
* You can resize images in G2 manually by browsing to a photo and clicking on ''Edit Photo'', then on the ''Modify Photo'' tab.
* 在G2中,你可以手动重设图片尺寸,打开一张相片,点击''编辑相片(Edit Photo)'',再点击标签''修改相片(Modify Photo)''


== Change Existing Image Sizes ==
== 修改已有图片尺寸 ==
Changing existing thumbnail and resize sizes in G2.0/2.0.1/2.0.2 is a pain. You have to go to each album, one by one, and edit the settings there.
在G2.0/2.0.1/2.0.2版本中修改已有缩略图和重设尺寸图片的尺寸是令人头疼的。因为你需要一个相册接一个相册地修改设定。


In G2.1 and later versions (and in the current nightly snapshots) you can change the settings recursively if you want to. That is, if you want to change the thumbnail size for all albums, browse to your [[Gallery:Root_Album|root album]], click ''Edit Album'' and then change the settings with the ''Use this thumbnail size in all subalbums'' checkbox ticked.
而在G2.1及以后的版本中(目前的nightly快照版本中)你可以按需要递归式地修改设定。即,如果你想改变所有相册的缩略图尺寸的话,就打开[[Gallery:Root_Album|根目录相册]],点击''编辑相册(Edit Album)'',然后复选''在所有下属相册中使用此缩略图尺寸''即可。


The new settings are only used for new images, that is, for images that will be added to this album in future. The thumbnails and resizes of existing images will not be changed unless you tick the ''Recreate thumbnails'' and ''Recreate resized images'' checkboxes respectively.
新的设定仅对新建的图片有效,即,新的设定决定之后添加进来的图片才适用于这样的改变。之前存在的缩略图和重设尺寸的图片不会被改变,除非你复选''重新创建缩略图''''重新创建重设尺寸的图片''才可以改变已有图片的尺寸。


== Generating Thumbnails and Resizes ==
== 缩略图和重设尺寸图片的生成 ==
You don't have to bother about generating thumbnails and resizes. They are generated automatically when they are needed. Since generating images is computationally expensive (it takes a moment to create a thumbnail or resize) you may want to have complete control on when exactly these images are generated.
你自己无需为缩略图和重设图片的生产操心。在需要的时候它们会自动生成。因为生成图片是计算昂贵的(computationally expensive)(即需要时间来生成缩略图和重设尺寸的图片),因此你可能希望计算机来自主把握这些图片的生成时机。


A few [[Gallery:How_to_Add_Items|add item methods]] (e.g. add item -> from browser) offer the ''Create thumbnails now'' in the upload view which forces G2 to generate the thumbnails right when the image is added and not later when it is first used.
一些[[Gallery:How_to_Add_Items|添加项目的方法]](如,add item -> from browser)在上传视图中提供''立即创建缩略图'',这将迫使G2在图片添加的同时就生成缩略图,而不是等到图片首次被使用之后才生产缩略图。
There is no such option for resizes yet.
目前重设尺寸的图片没有此选项。


You can force to generate / build all thumbnails and resizes of the whole installation by browsing to ''Site Admin'' -> ''Maintenance'' -> ''Build all thumbnails/resizes''. This task can take hours if you have thousands of images, but it can also finish in a few seconds for only a few images if your server is fast enough. Note that during the execution of this task your server will be slowed down considerably. You may also want to put G2 into maintenance mode (see config.php) during this operation.
你可以通过''Site Admin'' -> ''Maintenance'' -> ''Build all thumbnails/resizes''为整个安装生成/建立所有的缩略图和重设图片。但如果你有成千张的图片,那么这个过程就需要花费数个小时,但如果你的服务器速度够快的话,实际过程也就一眨眼的工夫而已。注意在执行此进程时,你的服务器速度将显著下降。而在此过程中,你可能有必要将G2设置为维护模式(见config.php)。


Thumbnails and resizes are not generated on each request. That would be too slow. Instead they are generated when they are first requested and then they are stored on the harddisk of your server. Note that thumbnails and resizes are derived from the original, thus we call them internally '''derivatives'''. That's why they are stored in cache/derivative/ in your G2 storage folder (usually g2data/).
缩略图和重设尺寸的图片并非按请求逐个生成的,因为这样实在够慢的。相反地,它们初次接收请求之后就生成了并接着被存储在服务器的硬盘中。要注意的是,缩略图和重设图片衍生于原始的图片,因此我们称它们为内部'''派生物(derivative)'''。这就是它们被存储在G2存储目录(通常是g2data/)下的cache/derivative/中的原因了。


[[Category:Gallery 2:Usage]]
[[Category:Gallery 2:Usage]]

2008年7月23日 (三) 10:55的最新版本

图片尺寸设定[ ]

此文介绍Gallery2中不同图片版式的各种类型,以及管理它们的方法。

介绍[ ]

Gallery2 (G2)显示上传至网站的图片。另外,G2为所有上传的图片生成小些的预览图片,我们称之为“缩略图(thumbnail)”。如果你没有对外观主题设定进行改变,G2就会在一个预览页面(相册页面)中显示9个缩略图。

如果你点击某个缩略图,G2就会为你显示一个较大的图片,并且带有图片的名称,描述及其他细节信息。如果你没有对设定做修改,你就会看到一个缩小尺寸/中等尺寸的图片,我们称之为重设尺寸的图片重设的图片(resize)。你可以配置不限数量的此类图片,并且某图片可用版式均列在(相片)页面的右上角。

在右上角你可以看见一个原尺寸图片的链接。即上传到Gallery2的图片的原始大小。

如果原始图片的格式不是web可见类型(tiff,wmf,tga...)的话,你就会在原始图片下方看见一个下载(download)链接。在这种情况下,原始尺寸的图片就是web可见的了(JPEG格式),并且与之前web不可见类型的图片具有相同的规格尺寸。

注意,你所看到及点击缩略图所产生的行为取决于你所使用的外观主题。在此我们介绍一下默认外观主题(matrix)下的行为。

要求[ ]

Gallery2仅当至少一个图片工具组件(imagemagick,netpbm,gd...)活动时才会生成缩略图和重设图片。

并非所有的的图片工具都能胜任所有格式的图片处理。ImageMagick支持的图片格式算是最多的了。它甚至可以生成PDF文件的缩略图和重设图片,尤其是图像等。

注意你的imagemagick/gd/netpbm不一定支持G2所罗列出的全部文件类型。这取决于imagemagick/netpbm二进制或gd library/php的编译方式。

参见:支持的MIME类型获取Gallery2支持的文件类型一览表。

设置图片尺寸[ ]

就站内的默认设定,可以浏览根目录相册点击编辑相册(Edit Album)并点击相册(Album)标签。

注意:

  • 如果需要的话,你可以为每个相册设置不同的缩略图和重设图片尺寸。只要浏览一个相册并点击编辑相册(Edit Album)就可以了。
  • 在G2中,你的图片没有上采样过程(upsampling),即,如果重设的尺寸比原图片大的话,就不会进行此创建动作。而缩略图的尺寸如果大于原始图片的尺寸的话,原始图片就会被当作缩略图使用。
  • 新建相册的设定继承父族相册的设定。因此,如果你希望新建的顶层相册含有满意的缩略图和重设图片尺寸,就需要在根目录相册中设置尺寸。

缩略图尺寸[ ]

  • 你可以为缩略图按像素设置最大尺寸。

生成的缩略图图像高宽比会与某原始尺寸图片相同。如果原始图片的宽比高是4:3而你选择的缩略图尺寸为160,那么缩略图就会变成宽×高=160像素×120像素。

如果squarethum模块为活动的话,那所有缩略图都会生成为方形尺寸规格,即宽与高相同,并且不受原始图片高宽比的限制。

注:

  • 你可以对每张照片的缩略图进行裁剪。你所要做的就是打开一张相片,点击编辑相片(Edit Photo)接着点击标签裁剪缩略图(Crop Thumbnail)
  • 你为任何项目可以上传一个不相关/特殊的图片。激活thumbnai模块,浏览到相册/相片,然后点击编辑相册(Edit Album)/编辑相片(Edit Photo),最后点击标签一般(General)就可以使用页面底部的自定义缩略图选项了。
  • 相册的缩略图被称为封面(highlight)相册封面(album highlight),因为这单独的一张缩略图代表了该相册中所有的照片。
  • G2选取一个相册中第一个被添加的图片作为相册封面。你可以打开某张相片点击作为封面(Make Highlight)来改变相册封面。
  • 如果你希望相册随机抽取其中的某张相片作为封面以展示所有照片的话,请激活该相册的randomhighligh模块

重新设定尺寸[ ]

  • 你可以为每个重设尺寸的图片设置最大像素尺寸。[ ] x [ ]中左边括号内填入的应该是重设尺寸图片的宽度,右边的则是高度。
  • 通过输入尺寸规格,你可以为中间尺寸图片设置任意数字。
  • 你可以设置重设图片的优先级/次序。列表顶部的重设图片尺寸则被作为默认的重设尺寸。每个相册在edit album -> 'album'中设置的尺寸排序即相片页面中重设图片版式的排列顺序。

生成的缩略图图片高宽比与原始尺寸的图片相同。你所输入的重设图片版式是宽与高的最大像素。

注:

  • 相册中每张相片具有各自的重设尺寸也是可以的。你所要做的就是,打开一张相片点击编辑相片(Edit Photo),然后再点击标签相片(Photo)

全尺寸[ ]

原始的全尺寸图片规格是不变的,除非你特别进行修改。如果要处理最新的800万像素数码相片的话,你可能需要在上传到G2之前重设(缩小尺寸/缩小样本尺寸)图片,这样做的目的就是减少带宽消耗和节省网站空间。

注:

  • Gallery Remote可以为你重设上传图片
  • sizelimit模块激活并且相册的尺寸限制(sizelimit)有定义(标签Album下的Edit Album)的话,当执行原始文件添加时,G2可自动为你完成该操作。这样原始文件就会被重设尺寸而重设尺寸的版式将会作为新的保存下来,而先前的则会被删除。
  • 在G2中,你可以手动重设图片尺寸,打开一张相片,点击编辑相片(Edit Photo),再点击标签修改相片(Modify Photo)

修改已有图片尺寸[ ]

在G2.0/2.0.1/2.0.2版本中修改已有缩略图和重设尺寸图片的尺寸是令人头疼的。因为你需要一个相册接一个相册地修改设定。

而在G2.1及以后的版本中(目前的nightly快照版本中)你可以按需要递归式地修改设定。即,如果你想改变所有相册的缩略图尺寸的话,就打开根目录相册,点击编辑相册(Edit Album),然后复选在所有下属相册中使用此缩略图尺寸即可。

新的设定仅对新建的图片有效,即,新的设定决定之后添加进来的图片才适用于这样的改变。之前存在的缩略图和重设尺寸的图片不会被改变,除非你复选重新创建缩略图重新创建重设尺寸的图片才可以改变已有图片的尺寸。

缩略图和重设尺寸图片的生成[ ]

你自己无需为缩略图和重设图片的生产操心。在需要的时候它们会自动生成。因为生成图片是计算昂贵的(computationally expensive)(即需要时间来生成缩略图和重设尺寸的图片),因此你可能希望计算机来自主把握这些图片的生成时机。

一些添加项目的方法(如,add item -> from browser)在上传视图中提供立即创建缩略图,这将迫使G2在图片添加的同时就生成缩略图,而不是等到图片首次被使用之后才生产缩略图。 目前重设尺寸的图片没有此选项。

你可以通过Site Admin -> Maintenance -> Build all thumbnails/resizes为整个安装生成/建立所有的缩略图和重设图片。但如果你有成千张的图片,那么这个过程就需要花费数个小时,但如果你的服务器速度够快的话,实际过程也就一眨眼的工夫而已。注意在执行此进程时,你的服务器速度将显著下降。而在此过程中,你可能有必要将G2设置为维护模式(见config.php)。

缩略图和重设尺寸的图片并非按请求逐个生成的,因为这样实在够慢的。相反地,它们初次接收请求之后就生成了并接着被存储在服务器的硬盘中。要注意的是,缩略图和重设图片衍生于原始的图片,因此我们称它们为内部派生物(derivative)。这就是它们被存储在G2存储目录(通常是g2data/)下的cache/derivative/中的原因了。