Commit 6cee81381 for imagemagick.org

commit 6cee813810f249645dc70209e29cf4044c64f4ec
Author: Dirk Lemstra <dirk@lemstra.org>
Date:   Thu May 14 21:50:37 2026 +0200

    Check if the TIFF file that is being read is a DNG file and then switch to the DNG decoder.

diff --git a/coders/tiff.c b/coders/tiff.c
index ba79c1c26..e2e655fbe 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -1226,6 +1226,9 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
     rows_per_strip,
     width;

+  uint64
+    dng_version;
+
   unsigned char
     *pixels;

@@ -1266,6 +1269,19 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
       image=DestroyImageList(image);
       return((Image *) NULL);
     }
+  if (TIFFGetField(tiff,TIFFTAG_DNGVERSION,&dng_version) == 1)
+    {
+      ImageInfo
+        *read_info;
+
+      TIFFClose(tiff);
+      image=DestroyImageList(image);
+      read_info=CloneImageInfo(image_info);
+      (void) CopyMagickString(read_info->magick,"DNG",MagickPathExtent);
+      image=ReadImage(read_info,exception);
+      read_info=DestroyImageInfo(read_info);
+      return(image);
+    }
   if (image_info->number_scenes != 0)
     {
       /*