rkalla / exiftool

Enhanced Java Integration for Phil Harvey's ExifTool.
Apache License 2.0
88 stars 57 forks source link

Ability to remove tags? #18

Closed angel120 closed 10 years ago

angel120 commented 10 years ago

Is this library able to remove existing tags?

For example, the following command will delete the given tags from the image: exiftool -n -S -GPSLongitudeRef='' -GPSLatitudeRef='' -GPSImgDirection='' -GPSLatitude='' -GPSAltitude='' -GPSLongitude='' -GPSImgDirectionRef='' -GPSAltitudeRef='' "~/NetBeansProjects/ExifTool/resources/2014-05-10 22.58.52.jpg"

I've been trying to achieve something similar in my application, but I haven't had any luck: http://pastebin.com/M5GpWPJN The above code leaves the image untouched, with the original metadata.

If I attempt to set the value to "0" instead of "", a ".jpg_original" file is generated, but the new ".jpg" file still contains the original location data.

Any clue what I'm doing wrong?

ghost commented 10 years ago

@angel120 That is exactly the command line that ExifTool for Java is building, the code starts here: https://github.com/thebuzzmedia/exiftool/blob/master/src/main/java/com/thebuzzmedia/exiftool/ExifTool.java#L1262

So when you run your code and then run it again (on the same image) the EXIF data is still all intact?

On line 32 of your example code, can you try printing out the hashmap values to make sure they are all the empty string as expected?

angel120 commented 10 years ago

I just tried the same code (with a few minor adjustments) on my Windows desktop, and my code worked as intended.

Earlier, I was using my Mac Mini (OSX Mavericks). The strange thing is, the Mini was able to grab exif data from the image but it just wasn't able to write to it.

ghost commented 10 years ago

Strange indeed - glad the code works, maybe a filesystem permission/protection setting on the Mini?

Closing issue.