final JpegImageData jpegImageData = directory.getJpegImageData();
if (jpegImageData != null) {
elements.add(jpegImageData);
}
final TiffImageData tiffImageData = directory.getTiffImageData();
if (tiffImageData != null) {
final DataElement[] data = tiffImageData.getImageData();
Collections.addAll(elements, data);
}
}
Collections.sort(elements, TiffElement.COMPARATOR);