bupy7 / yii2-widget-cropbox

This widget allows crop image before upload to server and send informations about crop in JSON format.
BSD 3-Clause "New" or "Revised" License
91 stars 33 forks source link

how to resize/crop and save cropped image #20

Closed harry-maulana closed 8 years ago

harry-maulana commented 8 years ago

thanks.. this is a smart tools, but i found some trouble for my case:

  1. how to resize/crop and save cropped image without use models (using controller)
  2. i got error in model (function aftersave(){} ) $image = Image::getImagine()->open($this->image->tempName);
    • what the meaning of tempName?

error say: PHP Notice – yii\base\ErrorException Trying to get property of non-object

bupy7 commented 8 years ago
  1. use controllers it is bad way. this widgets does not force follow examples upload image. it only examples :) and this widget is only wrapper of jquery-cropbox plugin.
  2. https://github.com/yiisoft/yii2/blob/master/framework/web/UploadedFile.php#L40
harry-maulana commented 8 years ago

oh.. i copy that. thanks bupy