]> granicus.if.org Git - imagemagick/commitdiff
Fix the new transparency logic in the Q8 case
authorglennrp <glennrp@git.imagemagick.org>
Thu, 8 Jul 2010 01:45:29 +0000 (01:45 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Thu, 8 Jul 2010 01:45:29 +0000 (01:45 +0000)
coders/png.c

index 5b08196e5727850ca55bc8a832e5723393a12b2f..686a3fa99347c434a2bef532f2089a07e9e3ae54 100644 (file)
@@ -2240,8 +2240,8 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
 #if (MAGICKCORE_QUANTUM_DEPTH == 8)  /* This needs testing. */
               else /* Reducing tRNS values from 16 to 8 merges some values */
                 transparent_color.opacity=(Quantum) (
-                    ping_trans_color->gray *
-                    (((1UL << ping_bit_depth)-1)/QuantumRange));
+                    (ping_trans_color->gray *
+                    QuantumRange)/((1UL << ping_bit_depth)-1));
 #endif
               if (logging != MagickFalse)
               {