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

Undefined index: dh #10

Closed shahzadthathal closed 8 years ago

shahzadthathal commented 8 years ago

I'm using 2.2 version of your extension.

If I browsed the image in my form and click on save button without clicking on crop button, I got this error Undefined index: dh, There should be some kind of handler , if crop button not clicked, then upload only image don't create thumbnail or create thumbnail of original image.

Thank you.

bupy7 commented 8 years ago

You need check at uploading file. If image not exists then why it need saving?

shahzadthathal commented 8 years ago

Hi Image exist but I tried to save image without click on Crop button and got this error.

bupy7 commented 8 years ago

Cropping is required. If you want simple save image then skip cropping step at model.

$this->image->saveAs(...);
shahzadthathal commented 8 years ago

Sometime if some one don't want to crop the image :)

bupy7 commented 8 years ago

@shahzadthathal Then check crop info field at information about crop. If crop info is empty and image is uploaded - just save it image, else cropping it and after saving. =)

shahzadthathal commented 8 years ago

okay Thanks :+1:

havoess commented 8 years ago

why Setting unknown property: bupy7\cropbox\Cropbox::optionsCropbox?

bupy7 commented 8 years ago

write me version of cropbox — С ув., Василий.

14 янв. 2016 г., в 20:11, 小酒酒 notifications@github.com написал(а):

why Setting unknown property: bupy7\cropbox\Cropbox::optionsCropbox?

— Reply to this email directly or view it on GitHub.

havoess commented 8 years ago

"bupy7/yii2-widget-cropbox": "*",

havoess commented 8 years ago

{ "name": "bupy7/yii2-widget-cropbox", "description": "This is widget wrapper of https://github.com/bupy7/jquery-cropbox. This widget allows crop image before upload to server and send informations about crop in JSON format.", "keywords": ["yii2", "extension", "widget", "crop image", "image"], "homepage": "https://github.com/bupy7/yii2-widget-cropbox", "version": "4.0.0", "type": "yii2-extension", "license": "BSD 3-Clause", "authors": [ { "name": "Vasilij Belosludcev", "email": "bupy765@gmail.com", "homepage": "http://mihaly4.ru" } ], "minimum-stability": "stable", "require": { "yiisoft/yii2-bootstrap": "", "bower-asset/jq-cropbox": "1.0." }, "autoload": { "psr-4": { "bupy7\cropbox\": "" } } }

bupy7 commented 8 years ago

4 version different between 3 version. You need rewrite configuration in call widget or use 3 version. — С ув., Василий.

14 янв. 2016 г., в 20:11, 小酒酒 notifications@github.com написал(а):

why Setting unknown property: bupy7\cropbox\Cropbox::optionsCropbox?

— Reply to this email directly or view it on GitHub.

havoess commented 8 years ago

谢谢!

tedyonly commented 8 years ago

When I save the message 'File D:\xampp\tmp\php95FA.tmp doesn't exist', please help.

bupy7 commented 8 years ago

@tedyonly check availability enctype to your a form

$form = ActiveForm::begin([
    'options' => ['enctype'=>'multipart/form-data'],
]);