This is an automated email from the ASF dual-hosted git repository.

THausherr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/main by this push:
     new 5c2039ebc5 TIKA-4776: Add regression test for Apple maker note LONG8 
tags (#2981)
5c2039ebc5 is described below

commit 5c2039ebc5e0b9f970229b6a2573313e105a42e2
Author: Dominik Schmidt <[email protected]>
AuthorDate: Fri Jul 31 04:43:43 2026 +0200

    TIKA-4776: Add regression test for Apple maker note LONG8 tags (#2981)
    
    * [TIKA-4776] Add regression test for Apple maker note LONG8 tags
    
    metadata-extractor 2.21.0 (already bumped on main) decodes the LONG8
    and SLONG8 TIFF format codes, so the Apple maker note tags written as
    LONG8 reach Tika now. The fixture is the still half of a real Apple
    Live Photo (iPhone 15 Pro, iOS 18.5) from the MIT licensed osxphotos
    test suite; the test pins the content identifier and the Live Photo ID
    (maker note tag 0x0017), which was dropped with metadata-extractor
    2.20.0.
    
    * [TIKA-4776] Shrink the fixture to the real EXIF payload
    
    Replace the full 1379953 byte iPhone photo with a 3203 byte HEIC that
    repackages the unmodified EXIF item (including the Apple maker note
    with the LONG8 tag 0x0017) into a minimal container. The picture item
    data is replaced by filler bytes; the asserted values still come from
    the original EXIF bytes.
---
 .../apache/tika/parser/image/HeifParserTest.java   |  26 +++++++++++++++++++++
 .../test-documents/testHEIC_livePhoto.heic         | Bin 0 -> 3203 bytes
 2 files changed, 26 insertions(+)

diff --git 
a/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/test/java/org/apache/tika/parser/image/HeifParserTest.java
 
b/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/test/java/org/apache/tika/parser/image/HeifParserTest.java
index 107f408620..dc279e7393 100644
--- 
a/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/test/java/org/apache/tika/parser/image/HeifParserTest.java
+++ 
b/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/test/java/org/apache/tika/parser/image/HeifParserTest.java
@@ -57,4 +57,30 @@ public class HeifParserTest extends TikaTest {
         }
     }
 
+    /*
+        testHEIC_livePhoto.heic carries the unmodified EXIF payload (including
+        the Apple maker note) of the still half of an Apple Live Photo
+        (iPhone 15 Pro, iOS 18.5), retrieved from the MIT licensed osxphotos
+        test suite:
+        
https://github.com/RhetTbull/osxphotos/tree/main/tests/Test-Live-15.7.2.photoslibrary
+        The EXIF item was repackaged into a minimal HEIC container (the
+        picture item data is replaced by filler bytes) to keep the fixture
+        small.
+     */
+    @Test
+    public void testAppleLivePhotoMakerNote() throws Exception {
+        //the content identifier pairs the still with its video half; the
+        //Live Photo ID (Apple maker note tag 0x0017) is written as LONG8 and
+        //was dropped before metadata-extractor 2.21.0. TIKA-4776
+        Metadata metadata = new Metadata();
+        try (TikaInputStream tis = 
getResourceAsStream("/test-documents/testHEIC_livePhoto.heic")) {
+            parser.parse(tis, new DefaultHandler(), metadata, new 
ParseContext());
+
+            assertEquals("CD28D161-D5EC-4CDE-8B60-DACCC1363B6B",
+                    metadata.get(ImageMetadataExtractor.UNKNOWN_IMG_NS + 
"Content Identifier"));
+            assertEquals("5283876",
+                    metadata.get(ImageMetadataExtractor.UNKNOWN_IMG_NS + "Live 
Photo ID"));
+        }
+    }
+
 }
diff --git 
a/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/test/resources/test-documents/testHEIC_livePhoto.heic
 
b/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/test/resources/test-documents/testHEIC_livePhoto.heic
new file mode 100644
index 0000000000..548dd7c2b4
Binary files /dev/null and 
b/tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/test/resources/test-documents/testHEIC_livePhoto.heic
 differ

Reply via email to