-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to read HEIC file #4132
Comments
Please see https://sharp.pixelplumbing.com/install#building-from-source for the additional install-time requirements to build sharp from source against a globally-installed libvips. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@lovell When I try use to npm install this way, I get the following error message.
|
Thank you both for your comments. I tried following the instructions from @iamocean but it resulted in the same error when I run the test script:
@lovell thanks for the suggestion.
|
@lovell I had assumed that this output means that it was able to find the heif encoder. Is that incorrect?
|
@iamocean That looks like an npm problem unrelated to sharp. @dirkmc HEIF is the container, HEVC is the codec, HEIC is the combination of these. I've added commit ae06f46 to make the output of Please can you provide the complete output of running |
@lovell thanks for clarifying 👍 Here is the output with
|
It looks like you're trying to use an Intel-based Homebrew environment with an ARM64-based Node.js executable, which won't work. Perhaps you're running Homebrew under Rosetta emulation? If you want to do this, you'll also need to run Node.js under Rosetta emulation. |
Well spotted @lovell, thanks 👍 I uninstalled intel-based Homebrew and installed ARM64-based Homebrew.
However when I run my test file I still get the error message:
|
Please can you provide the complete output of running |
Sure, here it is:
|
Thanks, this suggests sharp didn't find a globally-installed libvips. My best guess would be some kind of Homebrew-related configuration or architecture mismatch problem. Make sure the paths in |
Yes, you're right it was an environment problem - the ARM64-based Homebrew paths weren't set up correctly. Once I fixed the paths I was able to run the test script and successfully open a .heic file. |
@lovell I have a question, why do I need to install libheif and libvips separately? Can't you handle .heic format images without them? After running it, I get the error message
|
@iamocean Whilst HEVC remains patent-encumbered, the prebuilt binaries provided by sharp will not support HEIC (HEIF+HEVC) images. https://github.com/search?q=repo%3Alovell%2Fsharp+hevc+patent&type=issues |
Possible bug
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.sharp
as reported bynpm view sharp dist-tags.latest
.sharp.cache(false)
does not fix this problem.rotate()
orkeepExif()
does not fix this problem.What are the steps to reproduce?
I installed libheif and libvips with
Then I installed sharp, apparently succesfully. However I am still unable to convert a heic file to a jpg:
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
Output of sharp.format.heif:
libheif and libvips versions:
Please provide sample image(s) that help explain this problem
24fe87a508407a3ca5f19e81b7835f01.heic.zip
The text was updated successfully, but these errors were encountered: