--- a/rtengine/dcraw.cc	2022-10-31 10:15:32.417043414 +0100
+++ b/rtengine/dcraw.cc	2022-11-02 16:14:31.896107852 +0100
@@ -2688,49 +2688,69 @@ void CLASS canon_rmf_load_raw()
   maximum = curve[0x3ff];
 }
 
-
 void CLASS olympus_load_raw()
 {
   ushort huff[4096];
   int row, col, nbits, sign, low, high, i, c, w, n, nw;
   int acarry[2][3], *carry, pred, diff;
 
-  huff[n=0] = 0xc0c;
-  for (i=12; i--; )
-    FORC(2048 >> i) huff[++n] = (i+1) << 8 | i;
-  fseek (ifp, 7, SEEK_CUR);
+  fprintf (stderr,"olympus_load_raw: started: \n" );						/* kh. */
+
+  huff[n = 0] = 0xc0c;
+  for (i = 12; i--;)
+    FORC(2048 >> i) huff[++n] = (i + 1) << 8 | i;
+  fseek(ifp, 7, SEEK_CUR);
   getbits(-1);
-  for (row=0; row < height; row++) {
-    memset (acarry, 0, sizeof acarry);
-    for (col=0; col < raw_width; col++) {
+  for (row = 0; row < height; row++)
+  {
+    /* checkCancel();					only in LibRaw, not in RT	<---		kh.   */
+    memset(acarry, 0, sizeof acarry);
+    for (col = 0; col < raw_width; col++)
+    {
+      /* fprintf (stderr,"olympus_load_raw: row %u col %u \n", row, col);				kh. */
       carry = acarry[col & 1];
       i = 2 * (carry[2] < 3);
-      for (nbits=2+i; (ushort) carry[0] >> (nbits+i); nbits++);
+      for (nbits = 2 + i; (ushort)carry[0] >> (nbits + i); nbits++)
+        ;
       low = (sign = getbits(3)) & 3;
       sign = sign << 29 >> 31;
-      if ((high = getbithuff(12,huff)) == 12)
-	high = getbits(16-nbits) >> 1;
+      if ((high = getbithuff(12, huff)) == 12)
+        high = getbits(16 - nbits) >> 1;
       carry[0] = (high << nbits) | getbits(nbits);
       diff = (carry[0] ^ sign) + carry[1];
-      carry[1] = (diff*3 + carry[1]) >> 5;
-      carry[2] = carry[0] > 16 ? 0 : carry[2]+1;
-      if (col >= width) continue;
-      if (row < 2 && col < 2) pred = 0;
-      else if (row < 2) pred = RAW(row,col-2);
-      else if (col < 2) pred = RAW(row-2,col);
-      else {
-	w  = RAW(row,col-2);
-	n  = RAW(row-2,col);
-	nw = RAW(row-2,col-2);
-	if ((w < nw && nw < n) || (n < nw && nw < w)) {
-	  if (ABS(w-nw) > 32 || ABS(n-nw) > 32)
-	    pred = w + n - nw;
-	  else pred = (w + n) >> 1;
-	} else pred = ABS(w-nw) > ABS(n-nw) ? w : n;
+      carry[1] = (diff * 3 + carry[1]) >> 5;
+      carry[2] = carry[0] > 16 ? 0 : carry[2] + 1;
+      if (col >= width)
+        continue;
+      if (row < 2 && col < 2)
+        pred = 0;
+      else if (row < 2)
+        pred = RAW(row, col - 2);
+      else if (col < 2)
+        pred = RAW(row - 2, col);
+      else
+      {
+        w = RAW(row, col - 2);
+        n = RAW(row - 2, col);
+        nw = RAW(row - 2, col - 2);
+        if ((w < nw && nw < n) || (n < nw && nw < w))
+        {
+          if (ABS(w - nw) > 32 || ABS(n - nw) > 32)
+            pred = w + n - nw;
+          else
+            pred = (w + n) >> 1;
+        }
+        else
+          pred = ABS(w - nw) > ABS(n - nw) ? w : n;
       }
-      if ((RAW(row,col) = pred + ((diff << 2) | low)) >> 12) derror();
+      if ((RAW(row, col) = pred + ((diff << 2) | low)) >> 12) {						/* kh. */
+        fprintf (stderr,_("olympus_load_raw... throwing derror  \n"));					/* kh. */
+        derror();
+      }													/* kh. */
     }
   }
+  fprintf (stderr,"olympus_load_raw: %u rows %u columns loaded \n", row, col);				/* kh. */
+  fprintf (stderr,"olympus_load_raw: finished successfully. \n" );					/* kh. */
 }
 
 void CLASS minolta_rd175_load_raw()
@@ -7023,6 +7043,8 @@ void CLASS apply_tiff()
   uint64_t os, ns; // RT
   struct jhead jh;
 
+  fprintf (stderr,_("CLASS apply_tiff() started \n"));							/*  kh. */
+
   thumb_misc = 16;
   if (thumb_offset) {
     fseek (ifp, thumb_offset, SEEK_SET);
@@ -7090,7 +7112,8 @@ void CLASS apply_tiff()
       case 32770:
       case 32773: goto slr;
       case 0:  case 1:
-	if (!strncmp(make,"OLYMPUS",7) &&
+        fprintf (stderr,_("(tiff_compress) case 0: 1: \n"));							/*  kh. */
+	if ((!strncmp(make,"OLYMPUS",7) || !strncmp(make, "OM Digi", 7) ) &&					/*  kh. */
 		tiff_ifd[raw].bytes*2 == raw_width*raw_height*3)
 	  load_flags = 24;
 	if (!strcmp(make,"SONY") && tiff_bps < 14 &&
@@ -7112,10 +7135,14 @@ void CLASS apply_tiff()
 	  case 14: load_raw = &CLASS packed_load_raw;
 		   if (tiff_ifd[raw].bytes*4 == raw_width*raw_height*7) break;
 		   load_flags = 0;
-	  case 16: load_raw = &CLASS unpacked_load_raw;
-		   if (!strncmp(make,"OLYMPUS",7) &&
+	  case 16: 
+                   fprintf (stderr,_("(tiff_bps) case 16: \n"));							/*  kh. */
+	           load_raw = &CLASS unpacked_load_raw;
+		   if ((!strncmp(make,"OLYMPUS",7) || !strncmp(make, "OM Digi", 7) ) &&			/*  kh. */
 			tiff_ifd[raw].bytes*7 > raw_width*raw_height)
+                     fprintf (stderr,_("   (tiff_bps) case 16: load_raw = &CLASS olympus_load_raw - assign: -\n"));	/*  kh. */
 		     load_raw = &CLASS olympus_load_raw;
+                     fprintf (stderr,_("   (tiff_bps) case 16: load_raw = &CLASS olympus_load_raw - assigned\n"));	/*  kh. */
                    // ------- RT -------
                    if (!strncmp(make,"SONY",4) &&
                        (!strncmp(model,"ILCE-7RM3",9) || !strncmp(model,"ILCE-7RM4",9)) &&
@@ -7127,6 +7154,7 @@ void CLASS apply_tiff()
                        filters = 0x94949494;
                    }
                    // ------------------
+        fprintf (stderr,_("(tiff_compress) case 0: 1: end\n"));								/*  kh. */
 	}
 //	if (filters == 9 && tiff_ifd[raw].bytes*8 < raw_width*raw_height*tiff_bps)
 //	  load_raw = &CLASS fuji_xtrans_load_raw;
@@ -7218,6 +7246,7 @@ void CLASS apply_tiff()
 		&CLASS kodak_ycbcr_load_raw : &CLASS kodak_rgb_load_raw;
     }
   }
+  fprintf (stderr,_("CLASS apply_tiff() ended \n"));							/*  kh. */
 }
 
 void CLASS parse_minolta (int base)
