Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't pass Paperclip Thumb into Papercrop #48

Open
igolden opened this issue May 18, 2016 · 2 comments
Open

Can't pass Paperclip Thumb into Papercrop #48

igolden opened this issue May 18, 2016 · 2 comments

Comments

@igolden
Copy link

igolden commented May 18, 2016

Hey there, thanks for the awesome plugin!

Right now I'm using the plugin in my app to crop profile pictures. The issue is that some people upload really large photos, which makes Papercrop break (zoom issue, offcenter crop issue).

So my solution has been to process the images down to >1000px wide in Paperclip, and then I'd like to pass Papercrop that version of the image. But when I pass Papercrop @card.photo.url(:croppable), I get an undefined method error. I've tried a few other syntax ideas too, no luck.

How can I pass a processed version of my image to papercrop?

Thanks again for all your work on this gem my friend!

@igolden
Copy link
Author

igolden commented May 18, 2016

I just found a temporary solution, but I think this could be a great feature in the future.

For now, I process the "original" style, which gets passed to papercrop.

has_attached_file :photo, :styles => { original: "1000x1000>", medium: "300x300>" }, default_url: "/images/:style/missing.png"

@igolden
Copy link
Author

igolden commented May 18, 2016

It'd be great to do something like the following

<%= f.cropbox @user.photo(:croppable) %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant