Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of sharp that is not the latest, please open an issue against that package instead.
What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?
This does not happen on 0.33.5, but seemingly all versions above.
System:
OS: Linux 6.18 Manjaro Linux
CPU: (14) x64 Intel(R) Core(TM) Ultra 5 235U
Memory: 4.61 GB / 15.07 GB
Container: Yes
Shell: 4.3.3 - /usr/bin/fish
Binaries:
Node: 22.15.0 - /run/user/1000/fnm_multishells/2575629_1769414932838/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.9.2 - /run/user/1000/fnm_multishells/2575629_1769414932838/bin/npm
pnpm: 10.28.0 - /usr/bin/pnpm
npmPackages:
sharp: ~0.35.0-rc.0 => 0.35.0-rc.0
System:
OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
CPU: (4) arm64 Neoverse-N1
Memory: 13.48 GB / 15.41 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 22.22.0 - /opt/sdk/node_v22_aarch64/bin/node
npm: 10.9.4 - /opt/sdk/node_v22_aarch64/bin/npm
npmPackages:
sharp: ~0.35.0-rc.0 => 0.35.0-rc.0
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.
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() or keepExif() does not fix this problem.
What are the steps to reproduce?
Take sharp version greater or equal 0.34.0
Take any image
Encode AVIF or HEIF AV1 on x64 architecture machine
Take x64 encoded image and move to arm64 architecture machine
Encode any image on arm64 arch
Encoded image is green
What is the expected behaviour?
Image decodes without color glitches.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
( async ( ) => {
const sharp = require ( 'sharp' ) ;
const testImage = '2569067123_aca715a2ee_o.jpg'
console . log ( sharp . versions )
if ( process . arch === 'x64' ) {
await sharp ( testImage ) . heif ( { compression : 'av1' } ) . toFile ( 'test_image_x86.avif' )
// or .avif(), seems equally broken
// await sharp(testImage).avif().toFile('test_image_x86.avif')
await sharp ( 'test_image_x86.avif' ) . jpeg ( ) . toFile ( 'output/test_image_x86_x86.jpeg' )
}
if ( process . arch === 'arm64' ) {
await sharp ( testImage ) . heif ( { compression : 'av1' } ) . toFile ( 'test_image_arm.avif' )
await sharp ( 'test_image_arm.avif' ) . jpeg ( ) . toFile ( 'output/test_image_arm_arm.jpeg' )
await sharp ( 'test_image_x86.avif' ) . jpeg ( ) . toFile ( 'output/test_image_x86_arm.jpeg' )
}
} ) ( )
Please provide sample image(s) that help explain this problem
x64 to x64
arm64 to arm64
x64 to arm
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharpcompletes without error.node -e "require('sharp')"completes without error.If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
sharpas reported bynpm view sharp dist-tags.latest.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharpthat is not the latest, please open an issue against that package instead.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?This does not happen on 0.33.5, but seemingly all versions above.
System:
OS: Linux 6.18 Manjaro Linux
CPU: (14) x64 Intel(R) Core(TM) Ultra 5 235U
Memory: 4.61 GB / 15.07 GB
Container: Yes
Shell: 4.3.3 - /usr/bin/fish
Binaries:
Node: 22.15.0 - /run/user/1000/fnm_multishells/2575629_1769414932838/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.9.2 - /run/user/1000/fnm_multishells/2575629_1769414932838/bin/npm
pnpm: 10.28.0 - /usr/bin/pnpm
npmPackages:
sharp: ~0.35.0-rc.0 => 0.35.0-rc.0
System:
OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
CPU: (4) arm64 Neoverse-N1
Memory: 13.48 GB / 15.41 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 22.22.0 - /opt/sdk/node_v22_aarch64/bin/node
npm: 10.9.4 - /opt/sdk/node_v22_aarch64/bin/npm
npmPackages:
sharp: ~0.35.0-rc.0 => 0.35.0-rc.0
Does this problem relate to file caching?
The default behaviour of libvips is to cache input files, which can lead to
EBUSYorEPERMerrors on Windows.Use
sharp.cache(false)to switch this feature off.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?
What is the expected behaviour?
Image decodes without color glitches.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
Please provide sample image(s) that help explain this problem
x64 to x64
arm64 to arm64
x64 to arm