katuma
katuma copied to clipboard
Add Upload powers to katuma
WAT
I think it's something nice to have be able to upload images in an application.
Some uses could be:
- Users upload avatar.
- Products with photo.
- Group home photo ala Facebook page.
Tech
I'm talking about use something like paperclip or carrierwave or another one that you consider is better for our needs.
Voluntaries?
@enricostano , @edulan @sauloperez ? :)
Motivation
A part from real utility of being able to upload image in the app, for me is the psychological factor. It's very sad being developing the front end without see avatars. Come on :)
@andresgutgon I can take care of that as I already did for the photobooth.
From my experience, using gems like paperclip is the easiest way possible, at least for backend. We can also use workers for image processing. For frontend it requires a bit more work, as you'd have to adapt your XHR request to support multipart uploads.
We can talk about that offline if you want :+1:
I'm in of course with this, just let's talk about planning the implementation bearing in mind future use cases that we already are aware of.
For frontend it requires a bit more work, as you'd have to adapt your XHR request to support multipart uploads.
That's another story :) Let's add this feature to the backend and then we make the changes in the front end
This is another option https://rubygems.org/gems/dragonfly
Let's try to pick the most lightweight solution, if possible of course.
Here the winner is Paperclip
https://www.ruby-toolbox.com/categories/rails_file_uploads
That's not the right criteria IMO, please let's try to apply critical thinking.
What's the right criteria?
- Number of commiters
- Last commit
- Number of downloads
- Number of bugs
- ...
Consider refile (new library from the ones behind Carrierwave, it's supposed to be better.) https://github.com/refile/refile
Se also: https://ruby5.codeschool.com/episodes/626-episode-583-september-15th-2015/stories/4952-best-rails-image-uploader
Also for avatars there is a neat and free option at avatars.io (supports getting avatars from social networks, gravatar and even almost transparent uploads)
thanks @rewritten nice inputs!
on criterias @andresgutgon , the first one should be: what we actually need, knowing the use cases and choosing the right tool. Community adoption is of course something to take in account but should not lead us to blindly adopt stuff.
Thanks @rewritten nice!
@enricostano agree on put our needs before other criteria. But I think all those options are good for us. Aren't they?
If all those options are good for us (still not sure though) we should choose the one that requires less dependencies. And after that we can talk about community adoption.
If all those options are good for us (still not sure though) we should choose the one that requires less dependencies. And after that we can talk about community adoption.
Sounds good to me :+1:
:heart_eyes:
BTW just saying that experiment with webtorrent for managing our assets would super cool https://torrentfreak.com/webtorrent-brings-bittorrent-to-the-web-impresses-netflix-151213/ :trollface:
LOL
After taking a quick view into 3 candidates (refile, carrierwave and paperclip), I'd go with either paperclip or carrierwave, as they both have been around for a long time and heaily tested by the community.
Refile is pretty similar to paperclip, but also has sinatra as a dependency :scream:. IMHO seems too new for production (~ 1 year old) Carrierwave is more decoupled from AR and has only necessary dependencies, but if you want to use with Rails, it'll hack your models via AR::Model callbacks. I like the separated uploader class approach though. Paperclip is the classical choice, but maybe has more options than we really need. In the other side it's almost plug and play (very similar to carrierwave) and has interesting plugins like delayed_paperclip
Some metrics:
Open bugs count
- Refile: 5
- Carrierwave: 17
- Paperclip: 9
Active since
- Refile: Nov 2014
- Carrierwave: March 2009
- Paperclip: April 2008
@edulan you are the man :clap: +1 for Paperclip
Again we didn't analyzed our actual needs first :sob:
Again we didn't analyzed our actual needs first
What are our needs? Are they special? or we just want being able to upload images to our models?
I think the second is a good start
I think that Paperclip is too old actually
I think that Paperclip is too old actually
Lol @enricostano that's a valid argument? How it's that related with "our actual needs"
I was just playing the same game :trollface:
Soooooooo, can we use Paperclip?
Since all the available options have pretty nasty drawbacks and there is no neat and clean solution we can pick Paperclip. Democracy FTW :hand:
Since all the available options have pretty nasty drawbacks
Well, it's sofware and it's Open Source. You know? ;)
Can we prioritize this? I would add avatars (and uploads in general) after a first draft of the app.
I would like to see the basic workflow working even if not perfect from the UI point of view.
In the backend I would concentrate now on the following things:
- background jobs
- Mandrill integration for email delivery
- Mailchimp integration for mailing list on sign up
- missing endpoints
what do you think?
I think having uploads is not a priority but a really nice to have. If @edulan want to do it would be great. And integrating in the front end should not be too difficult.
It's not a #5min
task IMHO, and we have more basic stuff missing.
Of course if @edulan doesn't like any other missing part and want to implement uploads he's more than welcome!
I agree with @enricostano , we have too many basic things still to do. But in any case, I would go for CarrierWave. It's seems to be the more robust solution: https://infinum.co/the-capsized-eight/articles/best-rails-image-uploader-paperclip-carrierwave-refile