changeset 320:a4c6937dfaaf

Add some debug messages.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 09 Apr 2020 10:13:28 +0300
parents bf4115b6dc2a
children f07e3d79c421
files mgtool.php
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mgtool.php	Mon Apr 06 20:48:07 2020 +0300
+++ b/mgtool.php	Thu Apr 09 10:13:28 2020 +0300
@@ -287,12 +287,10 @@
 
       $chunk = unpack("c4id/L1size", $data);
 
-/*
-      printf("chunk: '%c%c%c%c' (%02x %02x %02x %02x) osize=%d\n",
+      mgDebug(sprintf("WebP chunk: '%c%c%c%c' (%02x %02x %02x %02x) size=%d\n",
         $chunk["id1"], $chunk["id2"], $chunk["id3"], $chunk["id4"],
         $chunk["id1"], $chunk["id2"], $chunk["id3"], $chunk["id4"],
-        $chunk["size"]);
-*/
+        $chunk["size"]));
 
       // Check for EXIF chunk
       if ($chunk["id1"] == 0x45 && $chunk["id2"] == 0x58 &&
@@ -359,6 +357,7 @@
   else
   {
     // Other fileformats, e.g. JPEG, PNG, GIF, ..
+    mgDebug("Falling back to generic XMP/EXIF read.\n");
 
     // Read EXIF ..
     if (fseek($fh, 0, SEEK_SET) < 0)