* Add resize_to_cover
* Add an initial resize_to_cover test
* Fix method name and add passing tests for VIPS
* Add cover method for MiniMagick and add tests
* Rearrange VIPS tests to match source code order
* Update CHANGELOG.md
* Add documentation for cover to both engines
Sometimes libvips is not able to identify the source image type, even if
there is a corresponding loader. In this case it's useful to be able to
tell libvips which loader to use. So, we add a `:loader` option that
does just that:
ImageProcessing::Vips
.loader(loader: :svg) # calls `Vips::Image.svgload`
# ...
For symmetry, we also add a `:saver` option, just in case libvips isn't
able to correctly identify the file extension of the destination path.
ImageProcessing::Vips
.saver(saver: :tiff) # calls `Vips::Image#tiffsave`
# ...
Closes#49
Vips::Image#remove removes metadata from a Vips::Image, which can be
useful for reducing filesize of an image or stripping potentially
sensitive data.
Like Vips::Image#set, it isn't chainable by default because the method
doesn't return a Vips::Image instance. Like #set, this commit makes
`#remove` chainable as well.
libvips 8.7 added magicksave, which saves the image using ImageMagick,
and ImageMagick can save GIFs. So, as long as libvips 8.7+ is install
and compiled with ImageMagick support, saving GIFs will automatically
work.
This was recommended by the libvips author in
https://github.com/jcupitt/libvips/issues/1095.
Also, since `vips_rotate()` was added to libvips 8.7 as a convenience
alias for `vips_similarity()` and we wouldn't want to break it, we
forward all additional options to `vips_similarity()`, like
`vips_rotate()` probably does.
* Add :mode, :gravity, and :offset parameters for Vips#composite
* Replace :compose and :geometry parameters with :mode and :offset in
MiniMagick#composite
This change makes it possible to position watermarks with the libvips
implementation.
On MiniMagick this wraps the -composite operator along with its
parameters. On libvips this provides a thin wrapper around
Vips::Image#composite.
Closes#35
Previously only operations were allowed in #apply. This commit extends
it to accept any builder commands, which includes :convert, :loader,
:saver etc. This will be useful for Active Storage, as it will allow
users to add conversion, loader and saver options to their on-the-fly
transformations.
This change also allows values given to #apply to be Hashes, which
previously wasn't possible in case someone wanted to use it for a
certain libvips operation.
This also brings back MiniMagick's support for "+" operators, which we
now document as well.
Both CarrierWave and ActiveStorage give the ability for the user to
provide a hash of operations that should be applied. Since the plan is
to make CarrierWave and ActiveStorage depend on ImageProcessing, I think
it's nice for ImageProcessing to provide this functionality out of the
box.
In addition to the hash of operations, we make sure we accept an array
of operations as well, so that users can repeat the same operation
multiple times.
This removes the ability for ImageProcessing::MiniMagick to accept
"false" for "+" operators in loader/saver options, but this wasn't
documented anyway. If this feature is requested, we'll find another way.
* include link to libvips benchmarks
* remove trailing whitespace
* change installation instructions to use multi-line code blocks
* remove upfront notices about automatic rotation and sharpening