Questions tagged [sharp]

Questions about sharp, a Node.js image processing library to resize, crop and optimize JPEG, PNG, WebP and TIFF images.

The typical use case for this high speed module is to convert large images in common formats to smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.

Resizing an image is typically 4x-5x faster than using the quickest [tag:imagemagick and settings.

Colour spaces, embedded ICC profiles and alpha transparency channels are all handled correctly. Lanczos resampling ensures quality is not sacrificed for speed.

As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available.

Most 64-bit OS X, Windows and Linux (glibc) systems running Node versions 4, 6, 8 and 9 do not require any additional install or runtime dependencies.

Download Sharp

455 questions
8
votes
1 answer

How can you resize an image in NodeJS using Sharp having only a URL, using async/await, and without a local copy being created?

I'm working in an environment where the available image processing library is NodeJS's Sharp for scaling images. It has been stable as it is being pipe based, but I'm tasked with converting it into TypeScript, and set it up using Async/Await when…
AntonMiles
  • 185
  • 1
  • 7
8
votes
2 answers

Sharp error: [Error: Input file is missing]

I download the image through request, and then process the image through sharp. But there is an error that input file is missing, actually the variable body has a value. import { IADLandingPageABTest } from '@byted/ec-types'; import request from…
geek machine
  • 173
  • 1
  • 2
  • 8
8
votes
1 answer

How to allow optional sharp image in graphql gatsby?

I typically have frontmatter that will have an array of objects, inside each object will be an image which will reference a string of a file relative to the markdown file. The problem is, the array could sometimes be empty, meaning graphql will have…
Joe Methven
  • 518
  • 4
  • 15
8
votes
0 answers

Issue With NodeJS Memory Consumption Statistics - Huge RSS & External Memory Usage

While working on performance testing for a Node Project, I came across some memory reports which are a bit confusing to interpret in terms of performance and memory leaks. Background So I generated the reports using process.memoryUsage() API that…
planet_hunter
  • 3,866
  • 1
  • 26
  • 39
7
votes
2 answers

sharp error: Package OpenEXR was not found in the pkg-config search path

I executed npm install on gatsby js directory on Mac. macOs is Big Sur Version is 11.4. gatsby version is 3.11.0 gatsby-plugin-sharp version is 3.11.0 this error log is shown. npm ERR! code 1 npm ERR! path…
KATUO
  • 311
  • 4
  • 17
7
votes
1 answer

Express Sharp install via Docker issue

I need to use sharp. Its work fine on my workspace but if I deploymeny via docker then I get error. I am implementation all steps. Error: 'linux-x64' binaries cannot be used on the 'linuxmusl-x64' platform. Please remove the 'node_modules/sharp'…
Kvlknctk
  • 634
  • 12
  • 27
7
votes
5 answers

Gatsby new fails to install the sharp package and breaks

I can't initiate a gatsby starter project. The new command process breaks down during initialization, and results in an error and non-compilable project. Here's the command: > gatsby new gatsby-test The follwing process starts, failing when during…
aviya.developer
  • 3,343
  • 2
  • 15
  • 41
7
votes
1 answer

Cordova-res not installing in ionic cordova

I am not able to install package Cordova-res in ionic 5.4.4v and getting the error below **Z:\my program V2\ionicTest\testProj>npm i -g cordova-res** C:\Users\USER\AppData\Roaming\npm\cordova-res ->…
Pritish kumar
  • 512
  • 6
  • 13
7
votes
6 answers

I cant install sharp using npm

I cant install sharp library using sudo npm install sharp. The terminal output: sharp@0.23.1 install /Users/kozakiewicz/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node…
Kozakiewicz1221
  • 71
  • 1
  • 1
  • 3
7
votes
1 answer

NodeJS Sharp Node Package Memory Consumption Issue

I am working on a NodeJS project that is using sharp node package for resizing JPEG/JPG images. The problem is Node process keeps adding the processed file in memory and never releases it. As a result, amount of memory consumed increases with every…
planet_hunter
  • 3,866
  • 1
  • 26
  • 39
7
votes
2 answers

Sharp package Heroku deployment issue

I'm deploying my NodeJs app to Heroku. No issues running the app with nodemon locally. However when I'm trying to push to Heroku Master, seems like "sharp" package is causing an issue: remote: -----> Installing dependencies remote: …
user1872384
  • 6,886
  • 11
  • 61
  • 103
6
votes
2 answers

How to use images from sharp module in React and Webpack project

Here is a codesandbox I would like the image in it to be processed by the sharp module. I want it to do this because I want this module to web optimize all the images in my React project, and to convert them to webm. Here's the same codesandbox…
Sam
  • 1,765
  • 11
  • 82
  • 176
6
votes
2 answers

How to resize image from S3 with Sharp?

I am trying to resize the uploaded image from S3 using @aws-sdk/v3 in Node.js API. First, I get the object (image) from S3 as shown here:…
Swix
  • 1,883
  • 7
  • 33
  • 50
6
votes
0 answers

win32-x64 binaries cannot be used on the 'linux-x64' platform

'win32-x64' binaries cannot be used on the 'linux-x64' platform got this error while installing node sharp on windows system. This is breaking my lambda code on aws while execution.
Ankit Singh
  • 325
  • 3
  • 12
6
votes
1 answer

Why does Sharp output the same file, even though I have changed the input file?

After scaling and coloring a JPG with Sharp, I immediately delete the input file. When I upload a new file with the same name, Sharp will output the old file. I'm running NodeJS on Ubuntu 16.04. Here is the code for editing the…
Asgeir
  • 593
  • 6
  • 21
1
2
3
30 31