You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Although #1372 partially relates to this, it was only ever really needed for GIF output, and there's a dedicated non-magick solution for doing this now.
Rather than re-open #1372 let's use this issue to track a more complete implementation of magicksave and magicksave_buffer. It will require exposing its format option, which might lead to a slightly confusing API as the sharp "format" will still be the value "magick" (rather than the magick "format" of the desired output format e.g. "bmp").
lovell
changed the title
Couldn't save bmp image to buffer or to file with ImageMagick support
Enhancement: more complete magicksave support
Nov 12, 2024
Although #1372 partially relates to this, it was only ever really needed for GIF output, and there's a dedicated non-magick solution for doing this now.
Rather than re-open #1372 let's use this issue to track a more complete implementation of magicksave and magicksave_buffer. It will require exposing its format option, which might lead to a slightly confusing API as the sharp "format" will still be the value "magick" (rather than the magick "format" of the desired output format e.g. "bmp").
how about:
Wrap magick* invoking in sharp toFile and toBuffer.
Sharp automatically invokes magicksave and magicksave_buffer, when the target format is not supported by sharp but is supported by *Magick.
Add a prefix to the formats supported by Magick, such as "magick_bmp".
This may also impact on sharp.format:FormatEnum.
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?Does this problem relate to file caching?
The default behaviour of libvips is to cache input files, which can lead to
EBUSY
orEPERM
errors 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?
resize
the image andtoBuffer
.What is the expected behaviour?
Could save bmp image to buffer or to file with ImageMagick support.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
Please provide sample image(s) that help explain this problem
The text was updated successfully, but these errors were encountered: