private float calculateExposureFromExif(ExifSubIFDDirectory exif) {
        float fNumber = 0.1f;
        try {
            fNumber = exif.getFloat(ExifSubIFDDirectory.TAG_FNUMBER);
        } catch (MetadataException e) {
        }
        float exposureTime = 0.005f;
        try {
            exposureTime = exif.getFloat(ExifSubIFDDirectory.TAG_EXPOSURE_TIME);
        } catch (MetadataException e) {
        }
        float iso = 100;
        try {
            iso = exif.getFloat(ExifSubIFDDirectory.TAG_ISO_EQUIVALENT);
        } catch (MetadataException e) {
        }

        if (fNumber == 0) {
            fNumber = 0.1f;
        }
        if (iso == 0) {
            iso = 100;
        }

        float value = (float) (Math.log(exposureTime / (fNumber * fNumber) * iso / 100.0) / Math
                .log(2));

        // Theoretically middle one should be set to 0 and other related to
        // it
        // eg. -1, -5, -3 => should be sorted => -5, -3, -1 and 'related' =>
        // -2,0,+2 but is's done in different place in different way
        System.out.println(fNumber + " / " + exposureTime + " / " + iso + " == " + value);

        return value;
    }