M
M
Mikha Pankratov2016-07-13 21:17:18
JavaScript
Mikha Pankratov, 2016-07-13 21:17:18

How to save a behever after a crop?

Good afternoon,

on the project I use Behever to save photos. ImageUploadBehavior suits me with everything.
now my task is to make a kopilnik, the choice fell on croppie, everything, as it were, was done, it cuts.

And here the complexity itself means, I need to save 5 files
1 - original,
2 - clipping from crop
3 - save 4 files with crop of the size I need.

The bihever does not have a spit, so that's the question.
That's not how I can't figure out how I can use the behever to save.
It is convenient and you do not want to produce a bunch of functions. Thank you all for your help!

https://foliotek.github.io/Croppie/
https://github.com/yii-dream-team/yii2-upload-behavior

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kim, 2016-07-13
@kimono

Derivate from it and add/change methods when saving images.
In particular:

/**
     * After file save event handler.
     */
    public function afterFileSave()
    {
        if ($this->createThumbsOnSave == true)
            $this->createThumbs();
    }

And specifically:
/**
     * After file save event handler.
     */
    public function createThumbs()
    {
      //...
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question