Skip to content

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

Description

@xiangnanscu
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");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions