开发者

Image upload options for website users

开发者 https://www.devze.com 2022-12-21 19:23 出处:网络
I want to be able to provide my website users with the ability to upload a profile picture. What are my options? What is the best way to do this? I would need to be able to limit the image size, crop

I want to be able to provide my website users with the ability to upload a profile picture. What are my options? What is the best way to do this? I would need to be able to limit the image size, crop / resize t开发者_StackOverflow中文版he image so that I can display thumbnails of the image. The website is written using Ruby on Rails


In alternate plugin to manage your upload file is carrierwave


The PaperClip plugin is pretty much the new hotness (standard):

http://github.com/thoughtbot/paperclip

It supports different image processors but we use ImageScience. RMagick leaks memory


I agree with the others recommendation of Paperclip for handling any kind of upload.

However for profile pictures in particular, if you are storing your user's email addresses you might like to consider using Gravatar, as StackOverflow does, to effectively "outsource" this functionality and let your users maintain consistent avatars among all the sites they use.

0

精彩评论

暂无评论...
验证码 换一张
取 消