- Prebuilt binaries now include mozjpeg and libimagequant (BSD 2-Clause)
- Prebuilt binaries limit AVIF support to the most common 8-bit depth
- Add `mozjpeg` option to `jpeg` method, sets mozjpeg defaults
- Reduce the default PNG `compressionLevel` to the more commonly used 6
Allow to provide any positive or negative multiple of 90 to `.rotate(...)`.
Negative angles and angles above 360 are converted to valid 0/90/180/270
rotations (0 rotations are still ignored).
Changes:
- [Node] Add `useExifOrientation` internal variable to know if the Exif
orientation must be used instead of the provided angle. This allows to save a
negative angle in the `angle` option, because the `-1` special case is not
needed.
- [Node] Change check for planed-rotation in extract, to prepare a
rotation before extraction: check with both `angle` and `useExifOrientation`
options.
I think this check contains a bit too much logics on rotation options. Maybe
we could move this condition to a dedicated function.
- [C++] Separate `CalculateRotationAndFlip` into two generic functions:
- `CalculateExifRotationAndFlip`: Calculate the angle of rotation and
need-to-flip for the given Exif orientation.
- `CalculateAngleRotation`: Calculate the rotation for the given angle.
One or the other function is used to calculate the rotation, depending on
wether the Exif orientation tag or the provided angle must be used.
- Add unit tests for `-3690`, `-450`, `-90`, `90`, `450`, `3690` and `-3780`,
`-540`, `0`, `180`, `540`, `3780` rotations
- Add `320x240` fixture image for tests.
Unrelated changes (squashed):
- Add ncoden to the list of contributors
Reduce production (sub)depedency count from 93 to 50.
Modernise dev tooling, e.g. use nyc, replace jshint with semistandard.
Make 'npm test' command consistent across platforms.
This replaces the single color 20000x14000 PNG with a 20000x14000
Grayscale JPG. On a Broadwell Core i7 @ 3.1 GHz this speeds up the
"Disabling limit works" test from ~6.2s to ~0.15s because it can use
jpeg resize-on-load optimizations.
This should fix occasional timeouts on Travis CI.
Update docs
Added a giant image for testing
Adding myself to contributors
Added tests to verify giant image can be opened
Extend test-win time limit (because of large images)