* 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
The following test currently fails on CI:
1) Failure:
ImageProcessing::Vips::#resize_and_pad#test_0006_accepts thumbnail
options [/home/runner/work/image_processing/image_processing/test/vips_test.rb:310]:
Expected 1 to be > 3.
By using `:entropy` instead of `:centre` the images differ more
according to DHash.
The `MiniTest` was renamed to `Minitest`:
https://github.com/minitest/minitest/commit/9a57c520ceac76abfe6105866f8548a94eb357b6
And the `MiniTest` constant is now loaded just when `MT_COMPAT` environment variable is set:
https://github.com/minitest/minitest/commit/a2c6c18570f6f0a1bf6af70fe3b6d9599a13fdd6
This fixes following issue:
~~~
$ ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
/builddir/build/BUILD/test/test_helper.rb:17:in `<top (required)>': uninitialized constant MiniTest (NameError)
class MiniTest::Test
^^^^^^^^
Did you mean? Minitest
from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /builddir/build/BUILD/image_processing-1.12.2/usr/share/gems/gems/image_processing-1.12.2/test/builder_test.rb:1:in `<top (required)>'
from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:dir>:220:in `glob'
from -e:1:in `<main>'
~~~
If the operations are coming from user input, this could allow the user
to execute arbitrary shell commands via `Kernel#system` and
`Kernel#spawn`:
ImageProcessing::Vips.apply({ system: "echo something" })
We prevent this by using `#public_send` instead of `#send`, which goes
to method missing instead of calling private methods, which include
`Kernel#system` and `Kernel#spawn`.
Phashion currently doesn't install on Apple Silicon, and it doesn't seem
it's going to get fixed.
An upside is that this will now work on JRuby as well, since dhash-vips
doesn't use C extensions.