Skip to content

Commit

Permalink
Deprecate crop, embed, ignoreAspectRatio, max, min, withoutEnlargement.
Browse files Browse the repository at this point in the history
These become options of the resize operation instead. #1135
  • Loading branch information
lovell committed Sep 30, 2018
1 parent 3c54eed commit c3274e4
Show file tree
Hide file tree
Showing 15 changed files with 1,841 additions and 332 deletions.
9 changes: 9 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ Requires libvips v8.7.0.

#### v0.21.0 - TBD

* Deprecate the following resize-related functions:
`crop`, `embed`, `ignoreAspectRatio`, `max`, `min` and `withoutEnlargement`.
Access to these is now via options passed to the `resize` function.
For example:
`embed('north')` is now `resize(width, height, { fit: 'contain', position: 'north' })`,
`crop('attention')` is now `resize(width, height, { fit: 'cover', position: 'attention' })`,
`max().withoutEnlargement()` is now `resize(width, height, { fit: 'inside', withoutEnlargement: true })`.
[#1135](https://github.com/lovell/sharp/issues/1135)

* Drop Node 4 support.
[#1212](https://github.com/lovell/sharp/issues/1212)

Expand Down
3 changes: 1 addition & 2 deletions lib/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ const Sharp = function (input, options) {
width: -1,
height: -1,
canvas: 'crop',
crop: 0,
embed: 0,
position: 0,
useExifOrientation: false,
angle: 0,
rotationAngle: 0,
Expand Down
Loading

0 comments on commit c3274e4

Please sign in to comment.