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
2
votes
3 answers

Something went wrong installing the "sharp" module, using node-loader in webpack

I use sharp and webpack with node-loader but I got this error: D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\dist\cms\core\server\express.js:150011 throw new Error(error); ^ Error: Something went wrong installing the "sharp"…
Sh eldeeb
  • 1,589
  • 3
  • 18
  • 41
2
votes
1 answer

Uploading multiple images with multer to AWS S3

I currently have a backend where i can upload multiple images using multer. these images are passed through sharp to resize the images to create a full and thumbnail image. An entry of the post is stored in my posts table in my database and the…
kd12345
  • 689
  • 10
  • 29
2
votes
1 answer

Sharp on aws lambda. No space left on device while using .toBuffer

I'm trying to resize images with a resolution of 16384x16384 and higher using nodejs sharp. While the function runs fine on a local machine, the problem appears on aws lambda. I get this error "Runtime.UnhandledPromiseRejection: Error:…
Terayon
  • 21
  • 2
2
votes
1 answer

Node/Sharp: Resizing thumbnails produces much larger images than expected

I am creating a function to resize thumbnails downloaded by youtube-dl. youtube-dl downloads 4 thumbnails, but they are not in the exact dimensions I need so they must be resized. Because the images I need are smaller than the largest thumbnail…
No stupid questions
  • 425
  • 1
  • 11
  • 31
2
votes
1 answer

Getting error while installing sharp in windows 64bit

I'm trying to install sharp in my nodejs project in windows using, npm install sharp But getting the following error: > sharp@0.26.2 install C:\Projects\React Native\done-with-it-api\node_modules\sharp > (node install/libvips && node…
Arfizur Rahman
  • 384
  • 4
  • 13
2
votes
0 answers

Error when using Sharp module in AWS lambda

I'm deploying a lambda on AWS that uses the Sharp module to resize an image. Despite using linux to deploy the following error happens: "Something went wrong installing the sharp module, Module parse failed: Unexpected character 'u007f' (1: 0), You…
2
votes
1 answer

How can I take the text from the h1 tag with Puppeteer Sharp?

My problem is: Iam trying to conext to http://example.com con Puppeteer Sharp and I want to show in the Console the text of de h1 tag from that page. The text is "Example Domain". I have this code: await new…
2
votes
1 answer

Node.js: Sharp package unable to install

I'm trying to install the Sharp package to compress buffers for images. Now when I install the package via npm install sharp --save, and try to use this line of code: const sharp = require('sharp'); I get the following error:…
HimmDawg
  • 97
  • 10
2
votes
2 answers

Keep rotation metadata with sharp node.js

I am working on an app that uses sharp for processing photos. Currently, when we resize and then write to buffer an image with sharp resize and toBuffer, by default the two of them wipe the EXIF data. We want to remove all metadata except for…
user156441
  • 175
  • 1
  • 6
2
votes
0 answers

Bad performance compositing images with Sharp

I have the task of stacking several pngs one on top of another and exporting it as one png. The images do not have the same size, however they do not need to be resized, just cropped to the available canvas. The images come from the file system and…
Mark E
  • 3,403
  • 2
  • 22
  • 36
2
votes
1 answer

Prebuilt libraries not found for sharp while generating Gatsby starter

I try to generate a Gatsby blog starter using following command: npx gatsby new my-blog-starter https://github.com/tomoyukikashiro/gatsby-starter-blog-amp-to-pwa While npm install is running the sharp thirdparty does not find its prebuilt binaries.…
Milan Tenk
  • 2,415
  • 1
  • 17
  • 24
2
votes
0 answers

how to get filepath from firebase storage and reupload it back from a path using cloud function?

I have an image that already stored in Firebase storage, I need to compress (not resize) the image so I can get smaller file size in Kb, but the width and height of that image is still the same. so the sequences are get image from firebase…
sarah
  • 3,819
  • 4
  • 38
  • 80
2
votes
1 answer

Use sharp on lambda@edge

I'm trying to use sharp on a couple of AWS lambda@edge. The idea is to resize and cache an image when requested (see this). I'm also using serverless with serverless-webpack to deploy the lambdas. I can deploy the lambdas and everything goes well if…
paezinc
  • 339
  • 1
  • 3
  • 13
2
votes
2 answers

JavaScript promise chain: I resize an image twice and express response becomes undefined?

If I resize an image twice (using the sharp library), my route returns undefined. All my resized images are showing up. It's like somehow, by calling image.resize and .toBuffer() twice, it's corrupting the res object. router.post('/submit',…
Glenn
  • 4,195
  • 9
  • 33
  • 41
2
votes
2 answers

Having trouble posting a photo directly to Instagram with InstagramApiSharp

I use the following code to post photos directly to Instagram But it gives error challenge_required. Where do you think the problem is? private async void btn_i_s_Click(object sender, EventArgs e) { var inbox = await…
hadi.aa
  • 43
  • 7