dlemstra / magick-wasm

The WASM library for ImageMagick
Apache License 2.0
571 stars 38 forks source link

Can't read attribute `exif:UserComment` #145

Closed biw closed 9 months ago

biw commented 9 months ago

magick-wasm version

0.0.28

Description

Hello, thanks for writing a great library. I've been testing reading metadata written by exiftool-vendored and I have an issue when reading exif:UserComment. It returns the string ASCII rather than the set value.

I also tried to install the package myself and debug but got the following issue when running npm install:

 401 Unauthorized - GET https://npm.pkg.github.com/download/@dlemstra/magick-native/0.202401.211644/e0461179a3b8940cc63cdde6fac732304f125bc2 - unauthenticated: User cannot be authenticated with the token provided.

Steps to Reproduce

To reproduce:

const outputPath = '~/Desktop/img.png'
// write a comment using exiftool
  exifTool.write(outputPath, {
        UserComment: JSON.stringify({
          x: 'info'
          // more JSON
          }),
      })

then

ImageMagick.read(new Uint8Array(text), async (image) => {
  console.log(image.getAttribute('exif:UserComment')) // prints 'ASCII'
})

Images

Fara12dday

dlemstra commented 9 months ago

Can you share a file that can be used to reproduce this issue. This project uses a native library that you will need to debug instead. If you would want to debug this I would advise you to debug the ImageMagick command line tools instead.

p.s. This project gets the native library from GitHub packages and that requires a token.

biw commented 9 months ago

This project uses a native library that you will need to debug instead. If you would want to debug this I would advise you to debug the ImageMagick command line tools instead.

p.s. This project gets the native library from GitHub packages and that requires a token.

Sorry for my late response, I missed the notification! It is indeed a problem with ImageMagick itself and I can recreate it with the command line too

Can you share a file that can be used to reproduce this issue.

One is included in the original post under images (the command line image)

I'm going to close this issue as it's not an issue with the wasm package 🙂