Closed taylorhakes closed 2 months ago
installed libvips on OSX
What is the output of running vips copy input.heic output.png
at the command line for your sample input image?
I have the same problem but with jpeg (tried png also to match above issue).
Running vips on the command line works for both png and jpeg for me.
Experiencing the same as above, just on a Linux container environment.
vips copy
works fine, but I get a seeking error like the OP.
Please remember that reading HEIC images requires sharp to be built from source against a globally-installed libvips + libheif + libde265 combo - see https://sharp.pixelplumbing.com/install#building-from-source
For those using a custom, globally-installed libheif, my best guess would be that this relates to its plugin system, which can be switched off at compile time using the -DENABLE_PLUGIN_LOADING
flag (set it to one of 0
, NO
or OFF
) as others have been directed to do at https://github.com/strukturag/libheif/issues/1250
I have the same problem, using an ubuntu-based container that should contain all the required libraries. This is the relevant snippet from my dockerfile:
RUN apt update && apt install -y libvips-dev libheif-dev
ENV SHARP_FORCE_GLOBAL_LIBVIPS=1
Using heif-convert
from the heif-examples package works fine.
heif-convert --list-decoders
output:
HEIC decoders:
- libde265 = libde265 HEVC decoder, version 1.0.15
AVIF decoders:
- aom = AOMedia Project AV1 Decoder v3.8.2
JPEG decoders:
JPEG 2000 decoders:
uncompressed: yes
I suppose sharp is not correctly building from source and does not use the globally installed libraries. How can I verify/debug this?
I suppose sharp is not correctly building from source and does not use the globally installed libraries. How can I verify/debug this?
All decisions are logged at install time. You might need to add the npm install --foreground-scripts
flag to display them.
https://sharp.pixelplumbing.com/install#building-from-source
Thank you for the hint. This revealed that the ubuntu packaged libvips has a version-mismatch with the latest version of sharp and is thus not building correctly. Building the correct versions of the libraries should resolve the issue for me.
I hope this information helped. Please feel free to re-open with more details if further assistance is required.
@lovell I am getting this error on a JPEG file, that came from my iphone together with a couple of other photos. Only this specific one is causing this error:
INFO Error: source: bad seek to 2298319
heif: Error while loading plugin: No decoding plugin installed for this compression format (11.6003)
at V.ro [as toBuffer] (/opt/nodejs/node_modules/sharp/lib/index.js:2:56542)
at Runtime.handler (/var/task/index.js:29:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
IMG_4838 is causing the error.
IMG_4537 is from the same group and works fine:
When I run the resize on my mac, it works fine by the way. But on the Lambda using release-x64.zip
version 0.35.
Any idea what to do about this?
It seems that IMG_4538.jpeg can also not be displayed in Github....but it works fine on my mac in Finder.
@mattiLeBlanc IMG_4838 is an HEVC-encoded HEIC image rather than a JPEG.
$ file 380390049-c42700ad-920f-4862-ad39-0589518e835d.jpeg
380390049-c42700ad-920f-4862-ad39-0589518e835d.jpeg: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile
$ heif-info 380390049-c42700ad-920f-4862-ad39-0589518e835d.jpeg
MIME type: image/heic
main brand: heic
compatible brands: mif1, miaf, MiHB, heic
image: 3024x4032 (id=49), primary
tiles: 6x8, tile size: 512x512
colorspace: YCbCr, 4:2:0
bit depth: 8
@lovell Is there any support for that, to convert HEICs? Or should I create a new build for that?
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.If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
yes, version
0.33.5
sharp
as 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
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
?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. Usesharp.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()
.[x] Using
rotate()
orkeepExif()
does not fix this problem.What are the steps to reproduce?
Installed
sharp
with node and installed libvips on OSX. I tried building from source as well.I get the following when running the code:
What is the expected behaviour?
Convert to PNG
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
Install sharp in OSX and try to convert HEIC files.
Please provide sample image(s) that help explain this problem
N/A