...

Download

ExifDriver

ExifDriver is a JAVA library which allows you to access meta information which are usually saved in JPEG images. For more info about the EXIF format see https://en.wikipedia.org/wiki/Exchangeable_image_file_format.

EXIF records usually contain additional information about the JPEG images. There are information about size, date, location, camera, focus, exposition time, etc.

ExifDriver is written in the JAVA language. And therefore allows you to access the EXIF information from JAVA or Android applications. EXIF records can be read or written. The following code shows the use example of the driver.

import java.io.File;
import rcs34.libs.ExifDriver.ExifDriver;
 
public class RCSExifDriverT {
 
  public static void main(String[] args) {
    //Load
    ExifDriver ed = ExifDriver.getInstance("example.jpg", false);
    printInfo(ed);
    //Modify
    ed.setUserComment("User comment can be set and can hold even 中文 characters");
    ed.save("modified.jpg");
    //Check
    System.out.println();
    ed = ExifDriver.getInstance("modified.jpg", false);
    printInfo(ed);
    //Delete
    File mFile=new File("modified.jpg");
    mFile.delete();
  }
 
  private static void printInfo(ExifDriver _ed) {
    System.out.println("File: " 
            + _ed.getSourceFile());
    System.out.println("Make: " 
            + _ed.getString(_ed.getIfd0(), ExifDriver.TAG_MAKE));
    System.out.println("Model: " 
            + _ed.getString(_ed.getIfd0(), ExifDriver.TAG_MODEL));
    System.out.println("Software: " 
            + _ed.getString(_ed.getIfd0(), ExifDriver.TAG_SOFTWARE));
    System.out.println("User comment: " + _ed.getUserComment());
    System.out.println("Time: " + _ed.getTime());
    int[] zoom = _ed.getDigitalZoom();
    System.out.println("Zoom: " + zoom[0] + "/" + zoom[1]);
    System.out.println("Orientation " 
            + _ed.getNumber(_ed.getIfd0(), ExifDriver.TAG_ORIENTATION));
    System.out.println("Exposure program " 
            + _ed.getNumber(_ed.getIfdExif(), ExifDriver.TAG_EXPOSURE_PROGRAM));
    int[] eTime = _ed.getRational(_ed.getIfdExif(), ExifDriver.TAG_EXPOSURE_TIME);
    System.out.println("Exposure time " + eTime[0] + "/" + eTime[1]);
    int[] fNum = _ed.getRational(_ed.getIfdExif(), ExifDriver.TAG_FNUMBER);
    System.out.println("FNumber " + fNum[0] + "/" + fNum[1]);
  }
 
}
 
 
Source parsed by GeShi

You can download ExifDriver as a JAR archive RCSExifDriver.jar. The JAR contains .class and .java (source) files. You can use it in your project as a JAR library or include the source files directly.