v1.3.0
This new release comes with a great Geometry
validation inside the new Geometry
class.
Geometry is really hard to validate in ImageMagick because it can have multiple forms, according to ImageMagick's documentation about Geometry.
Then, all current methods requiring a geometry parameter (resize
, crop
, etc.) now allow using a Geometry
instance to reinforce validation before executing the command (and catching the exceptions with a verbose explanation of what happened).
Also, the Geometry
class has an easy constructor with Geometry::createFromParameters
that allow specifying all parameters we need: width, height, X and Y offsets, and the aspect ratio option.
More than 700 tests were generated to be sure that the validation system is the same than the one present in ImageMagick itself.
Also, a big new feature about ::run()
method was introduced: you can now execute commands in three ways:
- Normally (nothing to do)
- In background (will append
> /dev/null 2>&1
to the command) - In debug mode (will append STDERR to STDOUT to retrieve the errors in the
CommandResponse::getContent()
method)
Just take a look at the RUN_*
constants in the Command
class.
New features
[ef52968] Start refactoring the Geometry validation
[044f25d] Many updates on the command class.
- Escape the geometry parameters (to avoid problems with "!" or "^" flags)
- Added "setEnv" for env vars, also added other IM commands: background, crop, extent.
- When using
run
, one can retrieve stderr in the output to watch for errors. - Removed many spaces form most commands.
[4b46ff0] Add new Geometry class to handle geometry use
[f1636aa] Created newRUN_
constants for running mode.Tests & CI
[a46c25d] Install ImageMagick manually to have latest version
[1f440a4] Show ImageMagick version in tests
[aad6c2b] Finalize geometry testing
[08576eb] Remove useless dev deps, optimize travis-ci
[510c3f5] Fixed tests
Code style
[738047a] Reorder methods to fit PSR style