Can I compress a file with image_magick and carrierwave gems? - carrierwave

carrierwave with image_magick (and rmagick for that matter) provides methods such as resize_to_fit, etc.
Is there a method I can call to compress my images by, say, 50%?

All you need to know is in the WIKI:
https://github.com/jnicklas/carrierwave/wiki/How-to%3A-Specify-the-image-quality

Related

What gem can I use to optimize and compress any file in ruby?

I understand there are several gems for image optimizations. However, I haven't come across any gem that will optimize or compress images files such jpeg, as well pdfs and doc files. Is there any gem which will optimize and compress any such files?
Optimization is a broad concept. Compressing images, for example, is optimization in itself. These are inheritently not part of a gem or language library but proper dedicated utilities like ImageMagick.
Gems like Carrierwave lets you upload an image and resize it on the go. Then there is ImageMagick's ruby wrapper, RMagick.
You can look for similar functions for documents/pdf.

Is it possible to do motivational poster with paperclip gem alone?

Is it possible to do motivational poster in rails with paperclip gem alone or will I need some kind of image processor like RMAGICK?
Paperclip defers to ImageMagick to process images, so you’ll need it anyway.

File uploading rails 3

I have a rails 3 app that has a comment system that allows a user to make comments. What I now wish to do is extend this further by enabling the user to attach/upload files to the comment system. Fairly easy question I am about to ask. What is the best tool/plugin or gem to use so that I can achieve this? I've done some thorough research and found that alot of these plugins such as carrierwave, paperclip and a few others are used to upload photos and I am not trying to do this.
Requirements
User should be able to upload/attach files
Can upload word, powerpoint or execel docuements
Both carrierwave and paperclip can be used to upload any type of files - they have extra features if you want to upload images, but they are not restricted to handling just image files.
In the end it's a matter of preference. I found both paperclip and carrierwave to be very good at what they do.
Paperclip
CarrierWave
As for me CarrierWave more modern and nice solution. Have a try.
You can use even dragonfly - https://github.com/markevans/dragonfly/

Which plugins/gems should I use to dynamically generate thumbnails on-the-fly in Rails 3?

So, the thing is. I'm building my first rails app which reads images from a directory and it's subdirs. Now, I want to generate dynamic thumbnails of those images. But I don't want to fill up that directory with the thumbnail images. I was thinking of caching these thumbs separately for each user in temporary directory.
Oh, and, I would also need the dimensions of the images for some css magic.
What plugins/gems/... should I use to accomplish this?
You should rmagick coupled with Paperclip. In this way you can specify the dimensions (and many other attributes of the images), and make thumbnails on the fly.
On top of this, I would also add in delayed_job which will background the process of the images so if any of them are provided by the client, they won't have to wait for it to complete client-side.
rMagick : http://github.com/rmagick/rmagick
Paperclip: http://github.com/thoughtbot/paperclip
delayed_job: http://github.com/collectiveidea/delayed_job

which gem to use for uploading photos for making albums

hi i've been googling around and cant really find the most obvius answer for which gem would be best to use.
if i would be using it for lets say creating albums, avatars and thumbnails. that means also allowing multiple pictures upload, ofcourse resizing them and maybe adding them borders.
i've come across RMagick, MiniMagick, PaperClip, Attachment_fu, Attribute_fu, ImageScience
which one do you reccomend and why? probably PaperClip would be best to handle simple stuff here. or maybe MiniMagick also. i'm not sure.
would appreciate any comments on these gems for uploading photos.
I would go with PaperClip. You will need to install RMagick and ImageMagick as well.
PaperClip gives you the ability to attach the images to columns in your model and easily implement them in your views/controllers.
RMagick provides a Ruby API to ImageMagick (which is a popular image manipulation library). You will need to install both ImageMagick and then RMagick. Then you can do things like create thumbnails and resize images programmatically. Almost all of the file attachement libraries will require RMagick/ImageMagick.
(I've also used attachment_fu in the past, that is a good gem as well -- PaperClip seems to be the most popular these days though.)

Resources