Giter Club home page Giter Club logo

Comments (6)

lovell avatar lovell commented on August 18, 2024 5

Hello, the EXIF data must be extracted from the JPEG image first.

For the image above try something like:

const sharp = require('sharp');
const exifReader = require('exif-reader');

sharp('56497304-40e89a80-64fd-11e9-9684-ee95b5d58567.JPG')
  .metadata()
  .then(({ exif }) => {
    const exifProperties = exifReader(exif);
    console.log(exifProperties);
  });

which outputs:

{ image:
   { Make: 'SAMSUNG',
     Model: 'SAMSUNG PL20,PL21 / VLUU PL20,PL21 ',
     Orientation: 1,
     XResolution: 96,
     YResolution: 96,
     ResolutionUnit: 2,
     Software: 'Microsoft Windows Photo Viewer 6.1.7600.16385',
     ModifyDate: 2019-01-14T11:31:13.000Z,
     YCbCrPositioning: 2,
     Copyright: 'COPYRIGHT, 2011',
     ExifOffset: 2360,
     ...

from exif-reader.

lovell avatar lovell commented on August 18, 2024 1

@WebReflection

  • exif-reader does not depend on sharp. If you need to extract EXIF data as a Buffer from an image then you can use sharp, but other solutions may be available.
  • sharp uses exif-reader to verify it was able to extract valid EXIF data as a Buffer as part of its unit tests and therefore includes it in devDependencies.

from exif-reader.

Benibur avatar Benibur commented on August 18, 2024

the same for me, I tried another lib that worked and also expected a buffer => the problem is in the lib I guess.
here is a photo failing :
SAM_2127_d47a

from exif-reader.

jamesdixon avatar jamesdixon commented on August 18, 2024

This bit me as well.

@lovell I believe it would make a lot of sense to include this functionality by default as the other libraries do as it's the standard use case for most.

Thoughts?

from exif-reader.

WebReflection avatar WebReflection commented on August 18, 2024

So, sharp depends on this module and this module requires sharp to work? That's a bit bizarre, imho.

from exif-reader.

WebReflection avatar WebReflection commented on August 18, 2024

@lovell thanks for clarifying that, I ended up using both sharp and exiftool a part, as it seems to be the standard. I might have a second look at this module though, since it works fine via sharp metadata.

from exif-reader.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.