evg2108 / carrierwave-crop-on-fly Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi. Thanks for your gem! I have one problem with reupload image.
I select image with aspect 16:9 from my pc, cropbox works correct. After i would exchange this image(16:9) with image 4:5 and this look so stretched. Can you help me solve my problem?
PS Sorry for my bad English :(
Hi, nice fork from the orginal one.
I have this issue
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
Request
Parameters:
{"utf8"=>"โ",
"authenticity_token"=>"MRa4sEXNc5+sfOkPMuy49YhR76Ykkixb5FPO9HK/s+k8uxAibLPWHHA940Zp0sXhZ+WAP1uew5tSNQIknk2MAQ==",
"user"=>{"avatar"=>#<ActionDispatch::Http::UploadedFile:0x007fa93a231be0 @crop_x="135.46",
@crop_y="100.72666666666666",
@crop_w="538.3666666666667",
@crop_h="618.2533333333333",
@tempfile=#Tempfile:/var/folders/_0/q8fjlt_537x1qf7f8jx500dc0000gn/T/RackMultipart20151217-63314-9yhro2.jpg,
@original_filename="andreas-2.jpg",
@content_type="image/jpeg",
@headers="Content-Disposition: form-data; name="user[avatar]"; filename="andreas-2.jpg"\r\nContent-Type: image/jpeg\r\n">,
"avatar_cache"=>""},
"commit"=>"Crop"}
My private controller for user looks like this
private
# Use callbacks to share common setup or constraints between actions.
def set_user
@user = User.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def user_params
params.require(:user).permit(:avatar, {avatars: []}, :avatar_cache, :favatar_crop_x, :avatar_crop_y, :avatar_crop_w, :avatar_crop_h)
end
end
Hi, I have issue when try to update(edit) scaffold crop image it will not update the image.
I have used the crop-on-fly here http://46.101.120.93/
Do I need profiles_controller.rb define the crop? https://github.com/vjandrei/rails4_snappaajat/blob/DeployTestCapistrano/app/controllers/profiles_controller.rb
Hi,
Thanks for amazing gem ;)
I installed in my app and i have an issue!
When the user already exist and have an avatar that was uploaded before, all the fields work fine.
<%= form_for @Profile do |f| %>
<%= f.cropbox :avatar, width: 250, height: 250 %>
<%= f.file_field :avatar %>
<%= f.previewbox :avatar %>
<%= f.submit 'Crop and Save' %>
But when there is no avatar yet "first time that avatar will be uploaded"
I get the message:
nil is not a valid asset source
And the two field that dont work are:
<%= f.cropbox :avatar, width: 250, height: 250 %>
<%= f.previewbox :avatar %>
How to deal with first time upload image?
Thanks a lot!
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.