krivochenko / yii2-cropper Goto Github PK
View Code? Open in Web Editor NEWYii-Framework widget for uploading and cropping images
Yii-Framework widget for uploading and cropping images
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
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:
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
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?
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?
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.
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']), ]) ?>
Hi, is it possible to specify the file name that will be saved?
Thanks
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
Hello
How do I edit existing image and save it.
Thanks in advance
How can I pass path to cropped image to my model?
У вас ошибка при работе жс валидации, если происходит ошибка валидации то некорректно отрабытывает ф-ция отображения ошибки (алерт на все поля формы) из за некоректнной работы 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);
yii2-cropper/actions/UploadAction.php
Line 85 in 67190a7
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?
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
It doesn't delete file when clicking Delete photo but only image from preview. How can I make it delete cropped image file.
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 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.
Hello. Its possible to obtain the name of the file uploaded and use it in a model?
Добрый день Сергей! Вроде с маленькими изображениями все нормально, но вот при загрузке большого - выделенная область не соответствует сохранённой обрезанной миниатюре. Как можно исправить?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.