Configuring retina quality
Closed this issue · 5 comments
Retina photos can have much lower jpg quality than regular photos
We need a way to configure it
Hey @glebm,
Can we also go with a default? E.g.
process :quality => 25
Or would you prefer a class attribute? E.g.
class ExampleUploader < CarrierWave::Uploader::Base
class_attribute :retina_quality
self.retina_quality = 50
version :small do
process :resize_to_fill => [30, 30]
end
include RetinaRails::CarrierWave
end
process :quality => self.class.try(:retina_quality) || 25
I still don't know what the best quality would be. According to this blogpost http://blog.netvlies.nl/design-interactie/retina-revolution/ you can strip a whole lot off.
I'd rather have a default.
I've been playing around with the values today, and 25 is great for photos, and images with graphic/text in them need anywhere between 30-40.
The best would probably be to add a retina_quality
processor, so that one can do
process resize_to_fill: [30, 30], quality: 60, retina_quality: 25
I've added the option to specify retina quality by adding a retina_quality
processor. It defaults to 40. Can you confirm it's working by adding the following line to your Gemifle?
gem 'retina_rails', :git => "git://github.com/jhnvz/retina_rails.git", :branch => "retina-quality"
I am actually not using retina_rails yet, because we generate just the retina photos in our app (so, no "normal"
version, instead we resize it in the browser). For photos and quality of 25 the retina image is the same size or smaller than the original, but looks just as good or better. Thomas Fuchs' http://retinafy.me/ is a great resource for this by the way.
Also, if only a retina version is generated, there is no need for a javascript helper anymore.
Thanks! Nice source by the way. I'm thinking about extracting this logic into a seperate gem or at least a seperate version eg 2.0