Java ExifToolWrapper.getTagsFromFile: get All tags?

Started by cvdenzen, September 16, 2010, 05:54:59 PM

Previous topic - Next topic

cvdenzen

Hello anyone,

Is it possible (in Java, ExifToolWrapper) to get all tags from a file? In Exiftool I would use the special All tag name to get all tags. But that does not seem to work in Java.
I tried this, when I uncomment the two lines that add known tag names, I get these tags. But with "All" I get an empty Map.
        HashSet hs=new HashSet<String>(10);
        //hs.add(TAGTHUMBNAILLENGTH); // De string "ThumbnailLength"
        //hs.add(CREATEDATE);
        hs.add("All");
        Map<String,String> resultaat=exifToolWrapper.getTagsFromFile(inputFile,hs);

Carl van Denzen

Phil Harvey

Hi Carl,

I'm not familiar with the Java wrapper, but the exiftool application (probably used by the wrapper) will return all tags if none are specified.  What happens if you leave "hs" empty, or maybe don't pass it to the function?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

cvdenzen

Phil, thank you for your response.
>:( I can not find a way to get all tags via the Java ExifToolWrapper. I will try to contact the author of ExifToolWrapper (or maybe code it myself into the wrapper). I tried your suggestions, but:
        // hs.add("All"); gives nothing, i.e. empty resultaat
        // hs=null; gives NullPointerException
        // Empty hs gives nothing, i.e. empty resultaat
        Map<String,String> resultaat=exifToolWrapper.getTagsFromFile(inputFile, hs);

There is no method that doesn't take a set of Tags (the variable hs in my code).
If there is a solution, I will try not to forget to post it into this forum.

Carl.

ryerman

Windows 10 Home 64 bit, Exiftool v12.61

cvdenzen

#4
Quote from: ryerman on September 17, 2010, 09:05:03 AM
How about hs.add("") or hs.add()

No, that is not going to work. I looked at the source and there is a line "if (tagNames.contains(tag))".

I changed the source and posted it as a feature request to the author (you can see it at SourceForge, feature request at project Moss).

Carl van Denzen

Edit: added link to feature request - PH