Ruby on Rails Sunday, January 24, 2016

> On Jan 23, 2016, at 8:38 PM, fugee ohu <fugee279@gmail.com> wrote:
>
> i thought bluimp gallery was gonna create thumbnails for me on the fly, but actually the docs say to build links to files in images and images/thumbnails so was I mistaken, how are thumbnails gonna get created for pictures uploaded by my site's users?

If you are using Paperclip or CarrierWave to do the uploading, both of them have a set of options for creating multiple versions of an uploaded file while it is being saved on the server. Assuming the upload is anything that the Image Magick library can open (which is quite a lot of formats) you are all set. Both of those "attachment" toolkits have extensive documentation explaining how to set this up and configure it.

There's another library called Dragonfly (and a very new one called Refile) that share another approach -- they "lazy-resize" images on the fly, and then cache them for re-use, so you only upload one size, then any time you want a different size, you pass a specially-crafted URL to the image rout, and the resized version is generated (or fetched from cache) on the fly.

Walter


>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ec38b658-8600-4a8a-8e6d-8c4f80104acf%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/83C652C7-EC76-4026-83CD-F39B23D2F097%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment