Giter Site home page Giter Site logo

yii2-cropper's People

Contributors

art009 avatar carlocaprini avatar dmitrybay avatar itsjereme avatar krivochenko avatar linuskohl avatar matvik avatar maxprihodko8 avatar oonne avatar softark avatar uraankhayayaal avatar xavsio4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-cropper's Issues

Regarding Storing file to S3

Is there any way to store files directly to s3 bucket instead of storing files to physical disc space ? can anyone put the code if there is or is there any alternative option for this ?
Is there any way to get data into base64 to store into S3

Apache crashes when cropping image

Hi. I have apache version 2.4 installed on Openserver. And when I try to crop image apache crashes and gives error POST http://yii2-starter-kit/admin/projects/uploadPhoto/ net::ERR_CONNECTION_RESET.
I have the following configuration:

field($model, 'avatar')->widget(Widget::className(), [ 'uploadUrl' => Url::toRoute('/projects/uploadPhoto'), 'width' => 370, 'height' => 290, 'cropAreaWidth' => 370, 'cropAreaHeight' => 290, ]) ?>

in ProjectsController:
public function actions()
{
return [
'uploadPhoto' => [
'class' => 'budyaga\cropper\actions\UploadAction',
'url' => 'http://yii2-starter-kit/uploads/projects',
'path' => '@frontend/web/uploads/projects',
]
];
}
.htaccess on root directory
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/admin/$
RewriteRule ^(admin)/$ /$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule ^admin(/.+)?$ /backend/web/$1 [L,PT]
RewriteCond %{REQUEST_URI} ^.$
RewriteCond %{REQUEST_URI} !storage
RewriteRule ^(.)$ /frontend/web/$1
Please, help

404 when cropping image

I have same problem. When I upload image, and submit button Crop photo, after in console of browser appears such a alert " http://localhost/st2/frontend/web/uploads/post/ Failed to load resource: the server responded with a status of 404 (Not Found) "

 <?= $form->field($model, 'image')->widget(Widget::className(), [
    'uploadUrl' => Url::toRoute('uploads/post/'),
]) ?>

.

}
public function actions()
{
    return [
        'uploadPhoto' => [
            'class' => 'budyaga\cropper\actions\UploadAction',
            'url' =>  Yii::$app->request->baseUrl.'/uploads/post/thumb',
            'path' => Yii::$app->request->baseUrl.'/uploads/post/thumb',
        ]
    ];
}

How can I fix it?

Delete Image should delete the file

Hi,
Thanks for great component. It works great!
However I have found that deleting the Image does not remove the file. It would be great functionality when user does a mistake and want to remove the file and re-generated cropped file.

The Simplest way would be defining another URL for delete where the onclick handler will pass the file name before removing the image in canvas.

Will you accept PR for that?

Drag and drop not working

I am experiencing a problem when trying to upload an image using "drag and drop" approach.
This error actually appears randomly.

The javascript console (Firefox) gives me the following error:

"TypeError: Argument 1 of FileReader.readAsDataURL is not an object.".

Attached is also a screenshot of the Chrome console.

schermata 2016-06-23 alle 10 35 11

Erron on crop

Hello, I would like to use this tool in Yii2, but unfortunately I get the following error:

Exception 'yii\base\InvalidArgumentException' with message 'Response content must not be an array.'

Appropriate rights in the controller for "upload" have been granted.

My files look like this:

Controller.php
public function actionUpload() { return [ 'uploadPhoto' => [ 'class' => 'budyaga\cropper\actions\UploadAction', 'url' => '/images/news', 'path' => '@frontend/web/images/news', ] ]; }

form.php
<?php echo $form->field($model, 'pictureFile')->widget(Widget::className(), [ 'uploadUrl' => URL::to(['news/upload']), ]) ?>

Filename

Hi, is it possible to specify the file name that will be saved?

Thanks

How to save full uploaded image?

Hello!

What to change in the widget code, if I would like to save full (uploaded) image. Meaning, the "crop" button isn't presses, just image file uploaded and the form submited.

Regards,
Mikk

неправильная работа js

У вас ошибка при работе жс валидации, если происходит ошибка валидации то некорректно отрабытывает ф-ция отображения ошибки (алерт на все поля формы) из за некоректнной работы parents на строке 131 в cropper.js
cropper.$widget.parents('.form-group').addClass('has-error').find('.help-block').text(error);
нужно всего лишь заменить на клозест
cropper.$widget.closest('.form-group').addClass('has-error').find('.help-block').text(error);
image

UploadUrl parameter

hi
i have an ActiveForm with several field and an image. I want to crop image for uploading.
im not sure if my uploudUrl is right.
it should be an action url?
if it is true, what should be happend in that action?

Need an option to save original image

As the title says, I need an option to save original image as well, but I don't see that option in your documentation.

And also, possibly an option to save a thumbnail of cropped image

Hide/show new-photo-area

Hello!
How can i hide/show "new-photo-area" , when i click "crop-photo" / "upload-new-photo" buttons?
I add "onClick" events for "crop-photo", and this works fine, "new-photo-area" is hide.
But when i added events for "upload-new-photo" button nothing happens, only opened file choosen dialog. onClick event is not fired

UploadAction, invalid uploadParameter

UploadAction has uploadParam not uploadParameter - like readme says.
And it cannot be changed, because in UploadAction:50 $file is hardcoded so compact() in :51 don't work.

Не правильно работает с большими изображениями

Добрый день Сергей! Вроде с маленькими изображениями все нормально, но вот при загрузке большого - выделенная область не соответствует сохранённой обрезанной миниатюре. Как можно исправить?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.