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

Can't parse array buffer returned by axios: Invalid EXIF data: buffer should start with "Exif", "MM" or "II". #37

Open
xiangnanscu opened this issue May 11, 2024 · 1 comment
Labels

Comments

@xiangnanscu
Copy link

import axios from "axios";
import exifReader from "exif-reader";

async function fetchAndParseEXIF(url) {
  try {
    const response = await axios.get(url, {
      responseType: "arraybuffer",
    });

    console.log("Buffer length:", response.data.byteLength);

    const exifData = exifReader(response.data);

    console.log(exifData);
  } catch (error) {
    console.error("Error fetching or parsing EXIF data:", error);
  }
}

fetchAndParseEXIF("http://lzwlkj.oss-cn-shenzhen.aliyuncs.com/jahy/vc-upload-1713346760053-4.jpg");
@lovell
Copy link
Collaborator

lovell commented May 11, 2024

Please see #11 (comment)

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