}
List<IPTCRecord> newRecords = new ArrayList<>();
for (IPTCRecord record : iptcRecords) {
if (record.iptcType.type == IPTCConstants.IPTC_TYPE_ORIGINATING_PROGRAM.type) {
newRecords.add(new IPTCRecord(IPTCConstants.IPTC_TYPE_ORIGINATING_PROGRAM,
"Dexifier by Andreas Reichart <andreas.reichart@gmail.com>"));
} else {
newRecords.add(record);
}
}
PhotoshopApp13Data pApp13Data = new PhotoshopApp13Data(newRecords, nonIptcBlocks);
iRewriter.writeIPTC(imageByte, bOutputStream, pApp13Data);
}
if (!removeExif && removeIptc) {
HashMap<String, Boolean> params = new HashMap<>();
params.put(SanselanConstants.PARAM_KEY_READ_THUMBNAILS, false);
JpegPhotoshopMetadata pMetaData = new JpegImageParser().getPhotoshopMetadata(new ByteSourceFile(f),
params);
assert (pMetaData != null);
// List<?> emptyRecords = pMetaData.photoshopApp13Data.getRawBlocks();
List<IPTCRecord> emptyRecords = new ArrayList<IPTCRecord>();
List<IPTCRecord> newRecords = new ArrayList<IPTCRecord>();
// List<IPTCRecord> emptyRecords = new ArrayList<IPTCRecord>();
newRecords.add(new IPTCRecord(IPTCConstants.IPTC_TYPE_SPECIAL_INSTRUCTIONS,
"Converted by DeExifier"));
// generate an empty App13 DataBlock
PhotoshopApp13Data newMetaData = new PhotoshopApp13Data(newRecords, emptyRecords);
// iRewriter.removeIPTC(resizedImageByte, bOutputStream);
// eRewriter.updateExifMetadataLossless(imageByte, bOutputStream,