Title: Image Cropper
Author: julioprotzek
Published: <strong>2011 年 7 月 21 日</strong>
Last modified: 2011 年 7 月 21 日

---

搜索插件

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

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

# Image Cropper

 作者：[julioprotzek](https://profiles.wordpress.org/julioprotzek/)

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

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

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

## 描述

For cropping a post thumbnail image to 200×300 pixels:

    ```
    <?php
        the_post();
        img(200, 300);
    ?>
    ```

This will verify the existence of post thumbnail, crop the image, save it in uploads
folder, and generate an image tag.

To verify the existence of a post thumbnail, you can use `has_img()`

    ```
    <?php if (has_img()): ?>
    <figure>
        <?php img(200, 300) ?>
        <figcaption>Some text</figcaption>
    </figure>
    <?php endif ?>
    ```

To crop images that are not post thumbnails, you can use `crop($url, $size)`

    ```
    <?php
        $cropped_url= crop( get_bloginfo('url') . '/wp-content/uploads/image.jpg', array(200, 300) );
    ?>
    <img src="<?php echo $cropped_url ?>">
    ```

## 安装

 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Done 🙂 Use the new template tags on your theme, eg `<?php the_post(); img(200,
    300); ?>`

## 常见问题

  When using img(), where does the image come from?

The img() template tag gets the image from your post thumbnail.

## 评价

此插件暂无评价。

## 贡献者及开发者

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

贡献者

 *   [ julioprotzek ](https://profiles.wordpress.org/julioprotzek/)

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

### 对开发感兴趣吗?

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

## 更新日志

#### 0.3.0

 * First public version.

## 额外信息

 *  版本 **0.3.0**
 *  最后更新：**15 年前**
 *  活跃安装数量 **40+**
 *  WordPress 版本 ** 3.0 或更高版本 **
 *  已测试的最高版本为 **3.2.1**
 *  语言
 * [English (US)](https://wordpress.org/plugins/image-cropper/)
 * 标签
 * [api](https://cn.wordpress.org/plugins/tags/api/)[cropper](https://cn.wordpress.org/plugins/tags/cropper/)
   [image](https://cn.wordpress.org/plugins/tags/image/)
 *  [高级视图](https://cn.wordpress.org/plugins/image-cropper/advanced/)

## 评级

尚未提交反馈。

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

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

## 贡献者

 *   [ julioprotzek ](https://profiles.wordpress.org/julioprotzek/)

## 支持

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

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