PHPackages                             thetigerduck/cropfield - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. thetigerduck/cropfield

ActiveSilverstripe-vendormodule[Image &amp; Media](/categories/media)

thetigerduck/cropfield
======================

Imegeupload with JCrop functionallity in frontend

013JavaScript

Since Nov 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/theTigerDuck/cropfield)[ Packagist](https://packagist.org/packages/thetigerduck/cropfield)[ RSS](/packages/thetigerduck-cropfield/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

TheTigerDuck cropfield
======================

[](#thetigerduck-cropfield)

CropField creates a ImageUploadField, allowing to select a CropArea in Frontend using Jcrop This new Version works with SS5 and does not depend on unclecheese/dropzone anymore. But it forks part of unclecheese's code.

@author TheTigerDuck

**Usage**

```
function ImageFrom(){
    $fields = new FieldList(
        $cf = new CropField("Image", "Image")
    );
    $cf->setBoxWidth(600);
    $cf->setBoxHeight(6000);
    $cf->setMaxWidth(0);
    $cf->setMaxHeight(0);
    $cf->setAspectRatio(1);
    $actions = new FieldList(
        new FormAction("submit", "submit")
    );
    return new Form($this, "ImageFrom", $fields, $actions);
}

function submit($data,$form){
    $original = Image::get()->byID($data['Image']['ID']);
    $cropped = $original->CroppedFromPos($data['Image']['width'], $data['Image']['height'], $data['Image']['posX'], $data['Image']['posY']);
    //overwrite the Original Image by the Cropped one
    $file = File::create();
    // Save file into backend
    $config = [
        'conflict' => AssetStore::CONFLICT_OVERWRITE,
        'visibility' => AssetStore::VISIBILITY_PUBLIC
    ];
    //genarate a unique filename to force regenerating image versions
    $hash = md5(rand().$profil->Email.$data['ProfilBild']['width'].$data['ProfilBild']['height'].$data['ProfilBild']['posX'].$data['ProfilBild']['posY'].$data['ProfilBild']['rotate']);
    $file->setFromLocalFile(Director::baseFolder() . "/public/" . $cropped->getSourceURL(), "Profilbilder/cropped/ProfileImage{$profil->ID}-{$hash}.".$cropped->getExtension(), null, null, $config);
    $file->write();
    $file->ClassName = Image::class;
    $file->write();
    $file->publishFile();
    $image = Image::get()->byID($file->ID);
    $image->publishSingle();
    $original->deleteFile();
    $original->doArchive();
    $profil->ImageID = $file->ID;
    $profil->write();
}

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6046cb1c5deba87e7f9f25ba3a7c31fcaefbb00037c608b352d324246755ad69?d=identicon)[TheTigerDuck](/maintainers/TheTigerDuck)

---

Top Contributors

[![theTigerDuck](https://avatars.githubusercontent.com/u/49946683?v=4)](https://github.com/theTigerDuck "theTigerDuck (5 commits)")

### Embed Badge

![Health badge](/badges/thetigerduck-cropfield/health.svg)

```
[![Health](https://phpackages.com/badges/thetigerduck-cropfield/health.svg)](https://phpackages.com/packages/thetigerduck-cropfield)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
