Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 9f69cdc

Browse files
authored
Merge pull request #381 from grimasod/bugfix/image-fit
Replace Sharp's crop function
2 parents 5aa8a4c + 7281462 commit 9f69cdc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Fixed
1010

1111
- Fixed some smaller issues with graphql so that it is now working again with the fronted - #350
12+
- Replaced the old `crop` function call which has been removed from Sharp image processor - @grimasod (#381)
1213

1314

1415
## [1.11.0-rc.1] - 2019.10.03

src/lib/image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export async function fit (buffer, width, height) {
4545
const transformer = sharp(buffer);
4646

4747
if (width || height) {
48-
transformer.resize(width, height).crop();
48+
transformer.resize(width, height, { fit: sharp.fit.cover });
4949
}
5050

5151
return transformer.toBuffer();

0 commit comments

Comments
 (0)