Giter Site home page Giter Site logo

Configuring retina quality about retina_rails HOT 5 CLOSED

glebm avatar glebm commented on September 14, 2024
Configuring retina quality

from retina_rails.

Comments (5)

jhnvz avatar jhnvz commented on September 14, 2024

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.

from retina_rails.

glebm avatar glebm commented on September 14, 2024

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

from retina_rails.

jhnvz avatar jhnvz commented on September 14, 2024

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"

from retina_rails.

glebm avatar glebm commented on September 14, 2024

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.

from retina_rails.

jhnvz avatar jhnvz commented on September 14, 2024

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

from retina_rails.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.