Skip to content
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

heif: unsupported feature #2924

Closed
vulcaryn opened this issue Oct 11, 2021 · 3 comments
Closed

heif: unsupported feature #2924

vulcaryn opened this issue Oct 11, 2021 · 3 comments
Labels

Comments

@vulcaryn
Copy link

Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest? 2.9.1

What are the steps to reproduce?

Load an image in sharp and use toBuffer() throw:

Error: source: bad seek to 821687
heif: Unsupported feature: Unsupported codec (4.3000)

What is the expected behaviour?

Get a Buffer

Are you able to provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem?

Just run (the file is zipped to avoid any possible changes made by GH file hosting):

(async function () {
    const fs = require('fs');
    const sharp = require('sharp');

    const rstream = fs.createReadStream('./test.HEIC');
    const chunks = []
    for await (let chunk of rstream) {
        chunks.push(chunk)
    }
    let buffer = Buffer.concat(chunks);

    const resizedBuffer = await sharp(buffer)
        .resize(200, 200, {fit: 'contain'})
        .toBuffer();
    
    console.log(resizedBuffer);
    setTimeout(() => process.exit(1), 1000);
})();

Are you able to provide a sample image that helps explain the problem?

test.HEIC.zip

What is the output of running npx envinfo --binaries --system?

  System:
    OS: macOS 11.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 171.17 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.14.0 - /usr/local/bin/node
    npm: 6.13.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman

Thanks.

@lovell
Copy link
Owner

lovell commented Oct 11, 2021

https://sharp.pixelplumbing.com/api-output#heif

Support for patent-encumbered HEIC images requires the use of a globally-installed libvips compiled with support for libheif, libde265 and x265.

Are you using a globally-installed libvips compiled with support for libde265?

@lovell lovell added question and removed triage labels Oct 11, 2021
@vulcaryn
Copy link
Author

Oh, no, I use the built-in version, i'll try this way

@vulcaryn
Copy link
Author

Ok, it works well with globally installer libvips.

Thanks and sorry for the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants