mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 03:55:28 -04:00
#403 Test case for uncommon resource.
This commit is contained in:
parent
2a40bdb14b
commit
6936e7cbb2
@ -43,7 +43,6 @@ public interface PSD {
|
|||||||
int RESOURCE_TYPE = ('8' << 24) + ('B' << 16) + ('I' << 8) + 'M';
|
int RESOURCE_TYPE = ('8' << 24) + ('B' << 16) + ('I' << 8) + 'M';
|
||||||
|
|
||||||
// http://fileformats.archiveteam.org/wiki/Photoshop_Image_Resources
|
// 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_IMAGEREADY = ('M' << 24) + ('e' << 16) + ('S' << 8) + 'a';
|
||||||
int RESOURCE_TYPE_PHOTODELUXE = ('P' << 24) + ('H' << 16) + ('U' << 8) + 'T';
|
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_LIGHTROOM = ('A' << 24) + ('g' << 16) + ('H' << 8) + 'g';
|
||||||
|
@ -30,12 +30,16 @@ package com.twelvemonkeys.imageio.metadata.psd;
|
|||||||
|
|
||||||
import com.twelvemonkeys.imageio.metadata.Directory;
|
import com.twelvemonkeys.imageio.metadata.Directory;
|
||||||
import com.twelvemonkeys.imageio.metadata.MetadataReaderAbstractTest;
|
import com.twelvemonkeys.imageio.metadata.MetadataReaderAbstractTest;
|
||||||
|
import com.twelvemonkeys.imageio.stream.SubImageInputStream;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.imageio.stream.ImageInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PhotoshopReaderTest
|
* PhotoshopReaderTest
|
||||||
@ -70,4 +74,16 @@ public class PSDReaderTest extends MetadataReaderAbstractTest {
|
|||||||
|
|
||||||
// TODO: More
|
// TODO: More
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPhotoshopResourcePHUT() throws IOException {
|
||||||
|
// Test sample contains non-8BIM resource: PHUT (PhotoDeluxe)
|
||||||
|
try (ImageInputStream stream = ImageIO.createImageInputStream(getResource("/psd/friends-phut-resource.jpg"))) {
|
||||||
|
stream.seek(38);
|
||||||
|
|
||||||
|
Directory directory = createReader().read(new SubImageInputStream(stream, 298));
|
||||||
|
|
||||||
|
assertEquals(9, directory.size()); // 6 8BIM + 2 PHUT + 1 8 BIM
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
Loading…
x
Reference in New Issue
Block a user