}
// Loop through all APPD segments, checking the leading bytes to identify the format of each.
for (byte[] appdSegment : segmentReader.getSegments(JpegSegmentReader.SEGMENT_APPD)) {
if (appdSegment.length > 12 && "Photoshop 3.0".compareTo(new String(appdSegment, 0, 13))==0) {
new PhotoshopReader().extract(new ByteArrayReader(appdSegment), metadata);
} else {
// TODO might be able to check for a leading 0x1c02 for IPTC data...
new IptcReader().extract(new ByteArrayReader(appdSegment), metadata);
}
}