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

Unified api to read the properties #6

Open
k3b opened this issue Jun 16, 2016 · 1 comment
Open

Unified api to read the properties #6

k3b opened this issue Jun 16, 2016 · 1 comment

Comments

@k3b
Copy link

k3b commented Jun 16, 2016

If i want to read metadata i have to look into the sourcecode of public void showMetadata() to find out how to get data from each Metadata implementation.

As a pixymeta user
i want a simple uniform api to get the desired meta-content
so that i donot have to learn much of the internals of the implementation.

I have started implementing this in my local IMetaApi branch of the https://github.com/k3b/pixymeta-android/ repository.

The api can be used like this.

Map<MetadataType, Metadata> metadataMap = Metadata.readMetadata(dir + "test.jpg");

StringBuffer result = new StringBuffer();

for (IMetadataDirectory directory : metadataMap.values()) {
    List<IMetadataTag> tags = directory.getTags();

    if ((tags != null) && (tags.size() > 0)) {
        for (IMetadataTag tag : tags) {
            result.append(tag.getName()).append(" : ").append(tag.getValue()).append("\n");
        }
    }

    final List<IMetadataDirectory> subdirectories = directory.getSubdirectories();

    if (subdirectories != null) {
        for (IMetadataDirectory sub : subdirectories) {
            ...
        }
    }
}
@dragon66
Copy link
Owner

dragon66 commented Jun 16, 2016

@k3b When I wrote pixymeta-android, I was having both metadata read and write functions in mind that's how the current pixymeta-android behaves.

Several of the metadata extracting tools define metadata based on image types and contain a common interface to view the metadata. I believe what you are trying to do is something similar to what metada-extractor does.

Anyway, this will by no doubt benefit the users at least with respect to extracting metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants