|
38 | 38 | import org.apache.xmpbox.type.BadFieldValueException; |
39 | 39 | import org.apache.xmpbox.type.DefinedStructuredType; |
40 | 40 | import org.apache.xmpbox.type.DimensionsType; |
| 41 | +import org.apache.xmpbox.type.LayerType; |
41 | 42 | import org.apache.xmpbox.type.PDFASchemaType; |
42 | 43 | import org.apache.xmpbox.type.ResourceEventType; |
43 | 44 | import org.apache.xmpbox.type.ResourceRefType; |
@@ -315,7 +316,7 @@ void testPDFBox3882() throws IOException, XmpParsingException |
315 | 316 | * @throws XmpParsingException |
316 | 317 | */ |
317 | 318 | @Test |
318 | | - void testPDFBox3882_2() throws XmpParsingException |
| 319 | + void testPDFBox3882_2() throws XmpParsingException, BadFieldValueException |
319 | 320 | { |
320 | 321 | // data modified from XMP data in the JPEG file in Apache Tika JpegParserTest.testJPEGXMPMM() |
321 | 322 | String s = "<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n" + |
@@ -367,6 +368,12 @@ void testPDFBox3882_2() throws XmpParsingException |
367 | 368 | " </rdf:Bag>\n" + |
368 | 369 | " </photoshop:DocumentAncestors>\n" + |
369 | 370 | " <photoshop:DateCreated>2012-04-30T12:54:48Z</photoshop:DateCreated>\n" + |
| 371 | + " <photoshop:TextLayers>\n" + |
| 372 | + " <rdf:Seq>\n" + |
| 373 | + " <rdf:li photoshop:LayerName=\"Name1\" photoshop:LayerText=\"Text1\"/>\n" + |
| 374 | + " <rdf:li photoshop:LayerName=\"Name2\" photoshop:LayerText=\"Text2\"/>\n" + |
| 375 | + " </rdf:Seq>\n" + |
| 376 | + " </photoshop:TextLayers>\n" + |
370 | 377 | " </rdf:Description>\n" + |
371 | 378 | " </rdf:RDF>\n" + |
372 | 379 | "</x:xmpmeta>\n" + |
@@ -398,6 +405,12 @@ void testPDFBox3882_2() throws XmpParsingException |
398 | 405 | assertEquals("xmp.did:49E997348D4911E1AB62EBF9B374B234", xmpMediaManagementSchema.getDocumentID()); |
399 | 406 | assertEquals("xmp.did:01801174072068118A6D9A879C818256", xmpMediaManagementSchema.getOriginalDocumentID()); |
400 | 407 | PhotoshopSchema photoshopSchema = xmp.getPhotoshopSchema(); |
| 408 | + List<LayerType> textLayers = photoshopSchema.getTextLayers(); |
| 409 | + assertEquals(2, textLayers.size()); |
| 410 | + assertEquals("Name1", textLayers.get(0).getLayerName()); |
| 411 | + assertEquals("Text1", textLayers.get(0).getLayerText()); |
| 412 | + assertEquals("Name2", textLayers.get(1).getLayerName()); |
| 413 | + assertEquals("Text2", textLayers.get(1).getLayerText()); |
401 | 414 | assertEquals("2012-04-30T12:54:48+00:00", photoshopSchema.getDateCreated()); |
402 | 415 | assertEquals("2012-05-03T09:34:50-04:00\tFile i1222b.jpg opened\n", photoshopSchema.getHistory()); |
403 | 416 | ArrayProperty ancestorsProperty = photoshopSchema.getDocumentAncestorsProperty(); |
|
0 commit comments