Movable Type 4 使用Netpbm生成缩略图

| No Comments

  今天把本站上的图片通通放到Google相册了。虽然相册空间不大,但是我喜欢它的缩略图的功能,这样因限制图片显示尺寸而看不清的问题就解决了,还能节省不少网页空间。

  当我去后台删图片时发现,他们都有缩略图了!看来是之前上传用来代替 Image::Magick 的 Netpbm 起作用了。可是,为什么上传了一个多月后才起作用呢?

  要是你也一直为MT4生成缩略图发愁,不妨接着往下看 ^_^

Image::Magick

Your server does not have Image::Magick installed, or Image::Magick requires another module that is not installed. This module is needed if you would like to be able to create thumbnails of uploaded images. Please consult the installation instructions for help in installing Image::Magick.

  如果 Movable Type 能够识别出主机安装了 GD 库,只是没有 Image::Magick ,那么只需在 mt-config.cgi 里面加上一行:

  ImageDriver GD

  MT 就可以使用GD库生成缩略图了,注意 ImageDriver 和 GD 之间有一个英文空格。

GD

Your server does not have GD installed, or GD requires another module that is not installed. This module is needed if you would like to be able to create thumbnails of uploaded images. Please consult the installation instructions for help in installing GD.

  要是你和我一样不走运,Movable Type 不认识主机上已经安装好了的GD库,那就试试使用Netpbm 生成缩略图吧,这个是照着 Sniptools 上面提供的方法做的,不过我没办法执行最后一步的命令,这或许是上传完不能马上起作用的原因吧 - -|

  下载 Netpbm ,我把它解压后放到 MT 的 mt-static 目录里面了,然后把每个文件的属性设置为755,同时还需要 IPC::Run 这个模块,如果主机里面没有 IPC::Run ,请参考这里。最后在 mt-config.cgi 中添加两行:

  ImageDriver NetPBM
  NetPBMPath /path/to/netpbm

  注意:NetPBMPath 后面一定要填写 netpbm 在主机中的绝对路径。如果你的主机提供了SSH,那你可以试试 Sniptools 上面给出的命令,然后上传一张图片或是自己的头像,看看 netpbm 是不是起作用了。

本文结束。

Leave a comment