Copilot commented on code in PR #3091:
URL: https://github.com/apache/tika/pull/3091#discussion_r3886272957


##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/main/java/org/apache/tika/parser/image/RawTiffParser.java:
##########
@@ -68,6 +69,11 @@
  * Both classic TIFF and BigTIFF containers (allowed for DNG since spec
  * version 1.7) are supported for preview extraction; for BigTIFF, EXIF
  * metadata extraction is skipped until metadata-extractor supports it.
+ * <p>
+ * The largest preview is marked
+ * {@link TikaCoreProperties.EmbeddedResourceType#THUMBNAIL}, any smaller
+ * ones are {@link TikaCoreProperties.EmbeddedResourceType#INLINE} images
+ * (TIKA-4851).

Review Comment:
   The class Javadoc states “The largest preview is marked … THUMBNAIL”, but 
previews can be filtered out (e.g., 
maxPreviewLengthBytes/maxTotalPreviewBytes), so this reads like an 
unconditional guarantee. Clarify that this applies to the previews that are 
actually extracted, and that the ordering is based on embedded JPEG byte length.
   
   This issue also appears on line 181 of the same file.



##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-image-module/src/test/java/org/apache/tika/parser/image/RawTiffParserTest.java:
##########
@@ -43,12 +43,27 @@ private List<Metadata> parseByName(String fileName) throws 
Exception {
         return getRecursiveMetadata(fileName, metadata);
     }
 
-    private void assertPreview(Metadata preview, int index, int width, int 
height) {
+    /**
+     * The largest preview: the file's thumbnail, always emitted first.
+     */

Review Comment:
   The helper Javadoc says the thumbnail is “always emitted first”. That’s true 
for the current default extraction path, but it’s clearer (and avoids 
overpromising) to describe this as the largest extracted preview that the test 
expects to be first and marked THUMBNAIL.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to