Sha256: 24bc66bd6320a0eea26e89a0a126ac06d09340356254d1f2e6b482aab9480bdd
Contents?: true
Size: 698 Bytes
Versions: 13
Compression:
Stored size: 698 Bytes
Contents
module Paperclip # Compresses the JPEG and PNG files class Compression < Processor def make case content_type when 'image/jpeg' then make_jpeg when 'image/png' then make_png else @file end end private def content_type first_processor? ? @file.content_type : Paperclip::ContentTypeDetector.new(@file.path).detect end def first_processor? @first_processor ||= @file.is_a?(Paperclip::AbstractAdapter) end def make_jpeg PaperclipCompression::Jpeg.make(@file, first_processor?, @options) end def make_png PaperclipCompression::Png.make(@file, first_processor?, @options) end end end
Version data entries
13 entries across 13 versions & 2 rubygems