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
1
vote
1 answer

Exit code: 1 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

I'm getting error while installing dependencies node_modules/sharp error. Please have a look at the picture. Package.json: { "name": "towni-staff", "version": "0.1.0", "description": "", "main": "index.js", "scripts": { "build":…
1
vote
0 answers

using lovell/sharp with angular project

I'm trying to use lovell/sharp with Angular universal project, but I have an issue. I build the server part via webpack and I added sharp to webpack's externals, but I got this error Unexpected character '�' (1:2) so, I added node-loader to webpack,…
Sh eldeeb
  • 1,589
  • 3
  • 18
  • 41
1
vote
0 answers

Docker node Error: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform

I am trying to run a container based on my app image by using docker and i getting the next error: /app/node_modules/sharp/lib/libvips.js:68 throw new Error('${vendorPlatformId}' binaries cannot be used on the '${currentPlatformId}' platform. Please…
Roy Stern
  • 11
  • 2
1
vote
1 answer

setup webpack and docker for sharp library

I am trying to use sharp (node image processing library) with docker and webpack. Everything works fine with my local environment on my own machine but when I am using docker things are not working and I get an error Can't find module sharp In…
Wael Showair
  • 3,092
  • 2
  • 22
  • 29
1
vote
1 answer

Input buffer contains unsupported image format

I have raised this on the lovell/sharp issues board too, but I was hoping there is someone out there who can give any tips on this. I have a lambda that is being triggered by SQS with a reference to a source image. Then I somehow source that image…
Gyula Soós
  • 467
  • 1
  • 9
  • 23
1
vote
1 answer

Get exact dimensions of resized image using Sharp

I have a Cloud Function that resizes an image uploaded to Cloud Storage using Sharp. Everything works, but I'm trying to find a way for Sharp to include metadata of the exact height and width of the new image. I could make a new function that uses…
Will Hlas
  • 1,241
  • 1
  • 6
  • 14
1
vote
0 answers

How to choose correct version of gatsby-plugin-sharp when using FreeBSD v11.3 server?

I'm trying to install and build Gatsby app on the FreeBSD v11.3 server. My gatsby app use gatsby-plugin-sharp and gatsby-transformer-sharp and I think those plugins cause the error. This was the first error I got during npm install: ERR! sharp…
Mimoid
  • 722
  • 1
  • 10
  • 25
1
vote
3 answers

sharp installation failed (npm) while installing cordova-res and sharp packages in linux

I have installed node and npm latest version in ubuntu 20.04 and debian buster. I already installed libvips and glib packages packages from the apt in linux /usr/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory …
Sivamani V
  • 61
  • 9
1
vote
1 answer

Sourcing a Gatsby image from Sanity.io is rendering a low quality and small image

I am working on a Gatsby site and sourcing my content from Sanity.io. Some of the images I am getting back from the Sanity.io CDN are of a significantly reduced quality when compared to images that I source through my own file system. I think it has…
1
vote
1 answer

How to compile Sharp js for AWS Lambda with Docker

I believe I need to build some binaries of a javascript image library (sharp js) and I have a docker command from the sharp js docs but it doesn't seem to be working properly docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x npm install…
Stib
  • 86
  • 1
  • 7
1
vote
1 answer

Losing image quality after resizing it

Hello guys i have following problem. On my website a user have the ability to upload images. That images are gonna get resized because of size and space on disk etc. I am using sharp to resize the image: https://www.npmjs.com/package/sharp In my…
bill.gates
  • 14,145
  • 3
  • 19
  • 47
1
vote
2 answers

Cannot send PNG via express route

I have an png image which I am serving from my express endpoint, the image should be readable as an image source. I have currently got the image as a buffer in node and I am trying to render it however I cannot seem to get the image to…
Rs Graphics
  • 183
  • 3
  • 14
1
vote
0 answers

Image compression using sharp in node js

I am building an app in flutter where user can upload image of max-size 20mb and want image to be compressed before storing it on server side. Basically compression will be done at server site. Ive tried sharp but it couldn't compressed even a…
Uttam Pandey
  • 31
  • 2
  • 8
1
vote
0 answers

createWriteStream success upload image but not generate access token

I've a image stream that result from sharp, after resizing the image I wanna upload it to google storage. Here is my code: const remoteWriteStream = storage .bucket(storageBucket) .file('products/'+mediumName) .createWriteStream({ …
Blackjack
  • 1,016
  • 1
  • 20
  • 51
1
vote
0 answers

Typescript: sharp.js transform a stream into multiple sizes and upload it to S3

The scenario here: Step 1: Get an uploaded image from GraphQL (So, thats a ReadableStream) Step 2: Use Sharp to generate image sizes Step 3: Upload all the image sizes on S3 Here is my code UploadRepository.ts import {FileUpload} from…
Gaurav112
  • 86
  • 2
  • 8