Class: PictureTag::ImageFile
- Inherits:
-
Object
- Object
- PictureTag::ImageFile
- Defined in:
- lib/jekyll_picture_tag/images/image_file.rb
Overview
Basically a wrapper class for vips. Handles image operations. Vips returns new images for Crop, resize, and autorotate operations. Quality, metadata stripping, and format are applied on write.
This deserves to be two classes and a factory, one for normal vips save and one for magicksave. This is illustrated by the fact that stubbing backend determination logic for its unit tests would basically require re-implementing it completely.
I'm planning to implement standalone imagemagick as an alternative to vips, so when I add that I'll also do that refactoring. For now it works fine and it's not too bloated.
Instance Method Summary collapse
-
#initialize(source, base) ⇒ ImageFile
constructor
A new instance of ImageFile.
Constructor Details
#initialize(source, base) ⇒ ImageFile
Returns a new instance of ImageFile.
15 16 17 18 19 20 |
# File 'lib/jekyll_picture_tag/images/image_file.rb', line 15 def initialize(source, base) @source = source @base = base build end |