Title: Dynamic Image Resizer
Author: Samuel Wood (Otto)
Published: <strong>2011 年 8 月 4 日</strong>
Last modified: 2012 年 4 月 30 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/dynamic-image-resizer.svg)

# Dynamic Image Resizer

 作者：[Samuel Wood (Otto)](https://profiles.wordpress.org/otto42/)

[下载](https://downloads.wordpress.org/plugin/dynamic-image-resizer.zip)

 * [详情](https://cn.wordpress.org/plugins/dynamic-image-resizer/#description)
 * [评价](https://cn.wordpress.org/plugins/dynamic-image-resizer/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/dynamic-image-resizer/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/dynamic-image-resizer/#developers)

 [支持](https://wordpress.org/support/plugin/dynamic-image-resizer/)

## 描述

Normally when you upload an image to a WordPress site, it creates several differently
sized versions of the image automatically. Themes can define custom image sizes 
as well, increasing the amount of images generated on your server.

This plugin changes the way WordPress creates images to make it generate the images
only when they are actually used somewhere, on the fly. Images created thusly will
be saved in the normal upload directories, for later fast sending by the webserver.
The result is that space is saved (since images are only created when needed), and
uploading images is much faster (since it’s not generating the images on upload 
anymore).

“Pretty” permalinks must be enabled for this plugin to function.

Note: This plugin does not work on multisite setups, due to the way WordPress handles
file serving in such situations (with ms-files.php).

Want regular updates? Become a fan of my sites on Facebook!
 http://www.facebook.
com/apps/application.php?id=116002660893 http://www.facebook.com/ottopress

Or follow my sites on Twitter!
 http://twitter.com/ottodestruct

## 安装

 1. Upload plugin to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. There is no configuration screen.

## 常见问题

  How does this work?

This plugin does two main things.

First, it sidesteps the part of WordPress that causes the resized images to be generated,
and simply tells the WordPress functions that the images already were generated.

Secondly, it hooks into the normal WordPress 404 handler. When a request is made
for an image that is not on the server, the normal WordPress permalink rules will
apply and WordPress will be triggered into action. It would normally serve up a 
404 page, however the plugin intercepts that and checks to see if a call for an 
image is being made. If so, and it can find the original image, then it resizes 
the image, saves it, and serves it back to the browser instead of the 404 page.

In order to do this, it changes the image naming system a little bit. Resized images
are normally renamed using a style of “image-123×456.jpg”, where the numbers are
the width and the height. This remains the case, however a new option is added. 
For cropped images, the plugin denotes this with the letter “c” at the end of the
image filename. This allows the plugin to determine the width, height, and whether
to use cropping or not just from the filename, and to create the proper image size.

  I changed themes, but my images stayed the same size.

This plugin doesn’t automagically adjust to new themes and new sizing. The image
sizes are specified in the filenames, so all the images in your posts content will
still be sized at the same sizes they were before.

However, if new sizes are defined by the new theme, and those filenames get generated
and requested by that theme, the plugin will generate the new sizes as they are 
retrieved. So while it can’t correct all cases, it can correct some of them.

  What about old images lying around?

The plugin doesn’t clean up old images. If old image sizes are left behind and unused
after changes, you’ll have to manually clean them up. One way is simply to delete
all the resized images (not the originals) and let images get regenerated when they
get used the next time.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Dynamic Image Resizer」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Samuel Wood (Otto) ](https://profiles.wordpress.org/otto42/)

[帮助将「Dynamic Image Resizer」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/dynamic-image-resizer)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/dynamic-image-resizer/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/dynamic-image-resizer/)，或通过[RSS](https://plugins.trac.wordpress.org/log/dynamic-image-resizer/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/dynamic-image-resizer/)。

## 更新日志

#### 1.0

 * Initial Release

## 额外信息

 *  版本 **1.0**
 *  最后更新：**14 年前**
 *  活跃安装数量 **200+**
 *  WordPress 版本 ** 3.2 或更高版本 **
 *  已测试的最高版本为 **3.2.1**
 *  语言
 * [English (US)](https://wordpress.org/plugins/dynamic-image-resizer/)
 * 标签
 * [Dynamic](https://cn.wordpress.org/plugins/tags/dynamic/)[image](https://cn.wordpress.org/plugins/tags/image/)
   [jpg](https://cn.wordpress.org/plugins/tags/jpg/)[resizer](https://cn.wordpress.org/plugins/tags/resizer/)
   [uploader](https://cn.wordpress.org/plugins/tags/uploader/)
 *  [高级视图](https://cn.wordpress.org/plugins/dynamic-image-resizer/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  5 条 5 星评价     ](https://wordpress.org/support/plugin/dynamic-image-resizer/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/dynamic-image-resizer/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/dynamic-image-resizer/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/dynamic-image-resizer/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/dynamic-image-resizer/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/dynamic-image-resizer/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/dynamic-image-resizer/reviews/)

## 贡献者

 *   [ Samuel Wood (Otto) ](https://profiles.wordpress.org/otto42/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/dynamic-image-resizer/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=otto%40ottodestruct%2ecom)