TiffProfileExifIFD extends TiffProfile { @Override public boolean satisfiesThisProfile (IFD ifd) { if (!(ifd instanceof ExifIFD)) { return false; } ExifIFD eifd = (ExifIFD) ifd; String version = eifd.getExifVersion (); for (String acceptedVersion : ACCEPTED_EXIF_VERSIONS) { if (acceptedVersion.equals (version)) { _majVersion = Integer.parseInt(version.substring(0, 2)); _minVersion = Integer.parseInt(version.substring(2, 4)); break; } } if (_majVersion == -1) { return false; } if (!("0100".equals(eifd.getFlashpixVersion ()))) { return false; } int colspc = eifd.getColorspace (); return !(colspc != 1 && colspc != 65535); } TiffProfileExifIFD(); @Override boolean satisfiesThisProfile(IFD ifd); int getMajorVersion(); int getMinorVersion();  }
@Test public void testSatisfiesThisProfileKO() { ExifIFD ifd = new ExifIFD(0, null, null, true); ifd._colorSpace = GOOD_COLORSPACE; ifd._exifVersion = BAD_EXIF_VERSION; ifd._flashpixVersion = GOOD_FLASHPIX_VERSION; assertFalse(profile.satisfiesThisProfile(ifd)); ifd._colorSpace = GOOD_COLORSPACE; ifd._exifVersion = GOOD_EXIF_VERSION; ifd._flashpixVersion = BAD_FLASHPIX_VERSION; assertFalse(profile.satisfiesThisProfile(ifd)); ifd._colorSpace = BAD_COLORSPACE; ifd._exifVersion = GOOD_EXIF_VERSION; ifd._flashpixVersion = GOOD_FLASHPIX_VERSION; assertFalse(profile.satisfiesThisProfile(ifd)); }