Title: Image Cropper
Author: julioprotzek
Published: <strong>21 juli 2011</strong>
Last modified: 21 juli 2011

---

Sök tillägg

Det här tillägget **har inte testats med någon av de 3 senaste huvudversionerna 
av WordPress**. Det kanske inte längre underhålls och kan ha kompatibilitetsproblem
när det används tillsammans med nyare versioner av WordPress.

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

# Image Cropper

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

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

 * [Detaljer](https://sv.wordpress.org/plugins/image-cropper/#description)
 * [Recensioner](https://sv.wordpress.org/plugins/image-cropper/#reviews)
 *  [Installation](https://sv.wordpress.org/plugins/image-cropper/#installation)
 * [Utveckling](https://sv.wordpress.org/plugins/image-cropper/#developers)

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

## Beskrivning

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 ?>">
    ```

## Installation

 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); ?>`

## Vanliga frågor

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

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

## Recensioner

Detta tillägg har inga recensioner.

## Bidragsgivare och utvecklare

”Image Cropper” är programvara med öppen källkod. Följande personer har bidragit
till detta tillägg.

Bidragande personer

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

[Översätt ”Image Cropper” till ditt språk.](https://translate.wordpress.org/projects/wp-plugins/image-cropper)

### Intresserad av programutveckling?

[Läs programkoden](https://plugins.trac.wordpress.org/browser/image-cropper/), kika
på [SVN-filförvaret](https://plugins.svn.wordpress.org/image-cropper/) eller prenumerera
på [utvecklarloggen](https://plugins.trac.wordpress.org/log/image-cropper/) via 
[RSS](https://plugins.trac.wordpress.org/log/image-cropper/?limit=100&mode=stop_on_copy&format=rss).

## Ändringslogg

#### 0.3.0

 * First public version.

## Meta

 *  Version **0.3.0**
 *  Senast uppdaterat **15 år sedan**
 *  Aktiva installationer **40+**
 *  WordPress-version ** 3.0 eller senare **
 *  Testat upp till **3.2.1**
 *  Språk
 * [English (US)](https://wordpress.org/plugins/image-cropper/)
 * Etiketter
 * [api](https://sv.wordpress.org/plugins/tags/api/)[cropper](https://sv.wordpress.org/plugins/tags/cropper/)
   [image](https://sv.wordpress.org/plugins/tags/image/)
 *  [Avancerad vy](https://sv.wordpress.org/plugins/image-cropper/advanced/)

## Betyg

Än så länge har inga recensioner skickats in.

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

[Se alla recensioner](https://wordpress.org/support/plugin/image-cropper/reviews/)

## Bidragande personer

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

## Support

Har du något att säga? Behöver du hjälp?

 [Visa supportforum](https://wordpress.org/support/plugin/image-cropper/)