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

Load common properties after calling ReadMetadata #278

Open
taurenshaman opened this issue Jan 20, 2021 · 3 comments
Open

Load common properties after calling ReadMetadata #278

taurenshaman opened this issue Jan 20, 2021 · 3 comments

Comments

@taurenshaman
Copy link

There are some commonly used properties for images, ref:

  • width, height, dpi
  • Author
  • Title, Comment, Keywords
  • CameraManufacturer
  • DateTaken
  • Copyright
  • Location
  • DateTaken
  • Format
  • Subject
  • Rating

So I hope there will be some helper method to get these properties from IReadOnlyList.
Example code:

var directories = MetadataExtractor.ImageMetadataReader.ReadMetadata( fileStream );
ImageInfo info = XXXX.Load( directories ); 
// ImageInfo or other name is a struct including properties above.
// or
string author = MetadataExtractor.Utils.ImageInfo.GetAuthor( directories );
int width = MetadataExtractor.Utils.ImageInfo.GetWidth( directories );

Thank you very much ❤❤❤

@taurenshaman taurenshaman changed the title Load common properties after calling ReadMetadata Load common properties after calling ReadMetadata #FeatureRequest Jan 20, 2021
@drewnoakes
Copy link
Owner

Thanks for your feature request. This is very similar in spirit to drewnoakes/metadata-extractor#10.

@arnvanhoutte
Copy link

Yes please! I need to access the copyright tag in my image but the directory I need to look in depends on the extension of the image, which makes it the code really ugly

@drewnoakes drewnoakes changed the title Load common properties after calling ReadMetadata #FeatureRequest Load common properties after calling ReadMetadata Jun 7, 2021
@vpenades
Copy link

vpenades commented May 2, 2022

I would like to know if there's been any update with this issue.

I think it's great to have an API so those that require it can browse into the details of the metadata... but if you just need some common properties, it's forcing everybody to reinvent the wheel into following the same steps to retrieve a given property.

maybe the solution would be to add a LINQ like API that would be implemented like this:

IEnumerable<Directory> directories = ImageMetadataReader.ReadMetadata(imagePath);

string title = directories.SelectTitles().FirstOrDefault();
string author = directories.SelectAuthors().FirstOrDefault();
GeoLocation loc = directories.SelectGeoLocations().FirstOrDefault();

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

No branches or pull requests

4 participants