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

Avif write error #78

Closed
shubhendusaurabh opened this issue Apr 24, 2023 · 2 comments
Closed

Avif write error #78

shubhendusaurabh opened this issue Apr 24, 2023 · 2 comments
Milestone

Comments

@shubhendusaurabh
Copy link

magick-wasm version

0.0.19

Description

magick-wasm throws error when writing to avif format.

Error: Encoder plugin generated an error: Unspecified: Failed to encode frame (8.0) /tmp/magick-Nb-b1-7Fk2cC_fSgRnnFZ8vGkUHAjfKB' @ error/heic.c/IsHEIFSuccess/139

Steps to Reproduce

sample code=> https://codesandbox.io/s/blissful-joliot-u2zwx6?file=/src/index.js

  file.arrayBuffer().then((d) => {
    initializeImageMagick()
      .then(async () => {
        ImageMagick.read(new Uint8Array(d), (image) => {
          image.write((data) => {
            const blob = new Blob([data], { type: `image/avif` });
            saveAs(blob, "avifimage.avif");
          }, MagickFormat.Avif);
        });
      })
      .catch((err) => {
        console.error("err", err);
      });
  });

Images

No response

@dlemstra
Copy link
Owner

I am in the middle of preparing a new release that will probably be published tomorrow. I can reproduce your issue on the master but I am getting this error message instead:

[Error]: Encoder plugin generated an error: Encoding problem: Tile encoder thread creation failed (8.5002) 
  `/tmp/magick-uLzqivPxr3RQKs9Evd7XTL2TU3GOgpnh' @ error/heic.c/IsHEIFSuccess/139

It seems there is an issue with creating a thread and that is expected of course but I don't know why this is happening. I will investigate this after the release.

@dlemstra dlemstra added this to the 0.0.21 milestone Apr 27, 2023
@dlemstra
Copy link
Owner

It took me a while but I figured out what was causing this. The aom library was build incorrectly and had threads enabled while it should be disabled. This issue has been fixed in the Magick.Native repository and will be resolved in the next release. I also added a unit test to make sure this stays fixed.

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

No branches or pull requests

2 participants