-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
- Running
npm install sharpcompletes without error. - Running
node -e "require('sharp')"completes without error.
Are you using the latest version of sharp?
- I am using the latest version of
sharpas reported bynpm view sharp dist-tags.latest.
What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?
System:
OS: Linux 6.17 Fedora Linux 43 (Workstation Edition)
CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Memory: 3.30 GB / 15.35 GB
Container: Yes
Shell: 5.3.0 - /bin/bash
Binaries:
Node: 22.20.0 - /usr/bin/node
npm: 10.9.3 - /usr/bin/npm
npmPackages:
sharp: ^0.34.4 => 0.34.4
Does this problem relate to file caching?
The default behaviour of libvips is to cache input files, which can lead to EBUSY or EPERM errors on Windows.
Use sharp.cache(false) to switch this feature off.
- Adding
sharp.cache(false)does not fix this problem.
Does this problem relate to images appearing to have been rotated by 90 degrees?
Images that contain EXIF Orientation metadata are not auto-oriented. By default, EXIF metadata is removed.
-
To auto-orient pixel values use the parameter-less
rotate()operation. -
To retain EXIF Orientation use
keepExif(). -
Using
rotate()orkeepExif()does not fix this problem.
What are the steps to reproduce?
'test.js':
require('sharp')('./image.png')
.metadata()
.then(
m => console.log('OK:', m),
e => console.log('ERR', e))run in electron context:
npx electron ./text.jsThe resulting process hangs then crashes with SIGSEGV
What is the expected behaviour?
Expected output:
OK: {
format: 'png',
width: 212,
height: 48,
space: 'srgb',
channels: 4,
depth: 'uchar',
density: 72,
isProgressive: false,
isPalette: false,
bitsPerSample: 8,
hasProfile: false,
hasAlpha: true,
autoOrient: { width: 212, height: 48 }
}
Note that running the code in nodejs or in electrons repl works fine.
node ./test.jsor
npx electron -ithen
require('./test')Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
https://gist.github.com/flynx/ed7ffbc9697586fa36ed416251826157
Originally posted to Electron's issue tracker:
electron/electron#48787