Skip to content

Commit

Permalink
Fix extract calls (lovell/sharp#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
teohhanhui committed Jun 14, 2016
1 parent c89edb0 commit d2936c6
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions src/streams/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ module.exports = function () {
r.resize(
d.resize.width,
d.resize.height
).extract(
d.crop.y,
d.crop.x,
d.crop.width,
d.crop.height
);
).extract({
left: d.crop.x,
top: d.crop.y,
width: d.crop.width,
height: d.crop.height
});

r.toBuffer(resizeResponse);
});
Expand All @@ -120,12 +120,12 @@ module.exports = function () {
r.resize(
d.resize.width,
d.resize.height
).extract(
d.crop.y,
d.crop.x,
d.crop.width,
d.crop.height
);
).extract({
left: d.crop.x,
top: d.crop.y,
width: d.crop.width,
height: d.crop.height
});
break;
case 'cut':
wd = image.modifiers.width || image.modifiers.height;
Expand All @@ -138,7 +138,12 @@ module.exports = function () {
wd,
ht
);
r.extract(d.y, d.x, wd, ht);
r.extract({
left: d.x,
top: d.y,
width: wd,
height: ht
});
break;
case 'scale':
// TODO: deal with scale
Expand Down

0 comments on commit d2936c6

Please sign in to comment.