resize() after composite() cause error
See original GitHub issueHi,
There is a wierd issue when Im trying to resize()
after composite()
, the source is:
sharp({
create: {
width: 789,
height: 789,
channels: 4,
background: '#bfff00'
}
}).png().composite([{ input: content }]).resize(192).toBuffer((err, data) => {
if (err)
return callback(err);
this.emitFile(target, data);
callback(null, '');
});
And it halted with Image to composite must have same dimensions or smaller.
If I deleted .resize(192)
, it works fine.
If I deleted .png()
, the same error would be occurred again.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Why does an SWT Composite sometimes require a call to ...
Looks to me like the layout's cache is outdated and needs to be refreshed. Layouts in SWT support caches, and will usually cache...
Read more >Resizing or Scaling -- IM v6 Examples - ImageMagick
Resizing will cause drastic changes to an image, and avoiding or minimizing ... That is, any position is preserved for later use by...
Read more >Resizing browser flickers black on all window managers
What steps will reproduce the problem? 1. Resize a browser window (with a window manager which draws the window as you resize) What...
Read more >Resizing images - High performance Node.js image processing
Resize large images in common formats to smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions.
Read more >ITOM Practitioner Portal - Micro Focus
Resizing the browser window opened with the HTML5 GRE Web Plug-in causes an error and reloads the page. Cause. This is a known...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You’ll need to break this into two pipelines, something like (untested):
Think @johannwagner is correct above, but regardless of the call order, to me it would seem to make more sense if the resize() is applied to the final composite image, not just the input base image, but not sure how others feel about that…?