Class: Dragonfly::LosslessRotate::Rotate
- Inherits:
-
Object
- Object
- Dragonfly::LosslessRotate::Rotate
- Defined in:
- lib/dragonfly/lossless_rotate.rb
Overview
Only JPEG format
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#call(content, degree = 90, optimize: nil, progressive: nil) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dragonfly/lossless_rotate.rb', line 26 def call(content, degree = 90, optimize: nil, progressive: nil) unless [90, 180, 270, -90, -180, -270].include?(degree) warn "Rotate only by 90, 180 and 270 degrees allowed" degree = 90 end optimize = content.env[:libjpeg_optimize] if optimize.nil? progressive = content.env[:libjpeg_progressive] if progressive.nil? rotate(content, degree, optimize, progressive) end |