mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-10-04 11:26:44 -04:00
#403 Support for uncommon PSD resource magic: MeSa, PHUT, AgHg and DCSR
This commit is contained in:
@@ -42,6 +42,13 @@ public interface PSD {
|
||||
/** PSD image resource marker "8BIM". */
|
||||
int RESOURCE_TYPE = ('8' << 24) + ('B' << 16) + ('I' << 8) + 'M';
|
||||
|
||||
// http://fileformats.archiveteam.org/wiki/Photoshop_Image_Resources
|
||||
// However, ExifTool says ImageReady is PHUT and PhotoDeluxe is MeSa... :-/
|
||||
int RESOURCE_TYPE_IMAGEREADY = ('M' << 24) + ('e' << 16) + ('S' << 8) + 'a';
|
||||
int RESOURCE_TYPE_PHOTODELUXE = ('P' << 24) + ('H' << 16) + ('U' << 8) + 'T';
|
||||
int RESOURCE_TYPE_LIGHTROOM = ('A' << 24) + ('g' << 16) + ('H' << 8) + 'g';
|
||||
int RESOURCE_TYPE_DCSR = ('D' << 24) + ('C' << 16) + ('S' << 8) + 'R';
|
||||
|
||||
/** IPTC image resource id. */
|
||||
int RES_IPTC_NAA = 0x0404;
|
||||
|
||||
|
@@ -64,9 +64,17 @@ public final class PSDReader extends MetadataReader {
|
||||
while (true) {
|
||||
try {
|
||||
int type = input.readInt();
|
||||
|
||||
if (type != PSD.RESOURCE_TYPE) {
|
||||
throw new IIOException(String.format("Wrong image resource type, expected '8BIM': '%08x'", type));
|
||||
|
||||
switch (type) {
|
||||
case PSD.RESOURCE_TYPE_IMAGEREADY:
|
||||
case PSD.RESOURCE_TYPE_PHOTODELUXE:
|
||||
case PSD.RESOURCE_TYPE_LIGHTROOM:
|
||||
case PSD.RESOURCE_TYPE_DCSR:
|
||||
// TODO: Warning for these types!
|
||||
case PSD.RESOURCE_TYPE:
|
||||
break;
|
||||
default:
|
||||
throw new IIOException(String.format("Wrong image resource type, expected '8BIM': '%08x'", type));
|
||||
}
|
||||
|
||||
short id = input.readShort();
|
||||
|
Reference in New Issue
Block a user