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

New api call: getImageMeta() #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

New api call: getImageMeta() #27

wants to merge 1 commit into from

Conversation

dberesford
Copy link
Owner

Returns the following image properties (which are not tags but still very handy to have when processing images):

{ fileName: '/path/books.jpg',
  fileSize: '993738',
  mimeType: 'image/jpeg',
  pixelHeight: '1200',
  pixelWidth: '1600' }

Exiv2 also outputs these by default, along with the high level summary exif tags.

struct stat buf;
stat(thread_data->fileName.c_str(), &buf);
thread_data->tags->insert(std::pair<std::string, std::string> ("fileName", thread_data->fileName));
thread_data->tags->insert(std::pair<std::string, std::string> ("fileSize", t_to_string(buf.st_size)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you pass these across as strings rather than integers?

properties (which are technically not tags):

    { fileName: '/path/books.jpg',
      fileSize: '993738',
      mimeType: 'image/jpeg',
      pixelHeight: '1200',
      pixelWidth: '1600' }

Exiv2 also outputs these by default, along with the high level summary
exif tags.
@drewish
Copy link
Collaborator

drewish commented Mar 12, 2015

This needs to be reworked to use NAN.

I'd suggest skipping the filename since that's passed in. I've also been thinking about how we could pass in the file contents as a buffer or filename. In the case of reading from a buffer there would be no filename. The other properties seem like they'd work though.

@whitelynx
Copy link

@drewish It looks like @bertrandom implemented reading/writing using Buffer at https://github.com/bertrandom/exiv2node-buffers, but it's definitely quite out of date. (it at least won't compile on Node.js v5.3.0)

@dberesford I'd love to see this PR updated to use NAN; I've also wanted to get this info along with the standard metadata tags.

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

Successfully merging this pull request may close these issues.

3 participants