]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 24 Nov 2011 18:47:12 +0000 (18:47 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 24 Nov 2011 18:47:12 +0000 (18:47 +0000)
MagickCore/quantum-export.c
coders/dpx.c

index b20d43798246b2cd085fefda07138bbb4631be8d..fd8a70fcede2e60884642206a90d36476a588ad2 100644 (file)
@@ -1362,21 +1362,21 @@ MagickExport size_t ExportQuantumPixels(Image *image,CacheView *image_view,
               for (x=0; x < (ssize_t) (number_pixels-2); x+=3)
               {
                 pixel=(unsigned int) (
-                  ScaleQuantumToAny(GetPixelIntensity(image,p+2),range) << 22 |
-                  ScaleQuantumToAny(GetPixelIntensity(image,p+1),range) << 12 |
-                  ScaleQuantumToAny(GetPixelIntensity(image,p+0),range) << 2);
+                  ScaleQuantumToAny(GetPixelIntensity(image,p+2*channels),range) << 22 |
+                  ScaleQuantumToAny(GetPixelIntensity(image,p+channels),range) << 12 |
+                  ScaleQuantumToAny(GetPixelIntensity(image,p),range) << 2);
                 q=PopLongPixel(endian,pixel,q);
-                p+=3;
+                p+=3*channels;
                 q+=quantum_info->pad;
               }
               if (x < (ssize_t) number_pixels)
                 {
                   pixel=0U;
                   if (x++ < (ssize_t) (number_pixels-1))
-                    pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p+1),
-                      range) << 12;
+                    pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p+channels),
+                  range) << 12;
                   if (x++ < (ssize_t) number_pixels)
-                    pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p+0),
+                    pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p),
                       range) << 2;
                   q=PopLongPixel(endian,pixel,q);
                 }
index f8ab20647b736740311d8fe13630426e50c6c4f0..e2e417e89b8925f0cf3add016a1580b53c47ecb0 100644 (file)
@@ -57,6 +57,7 @@
 #include "MagickCore/monitor.h"
 #include "MagickCore/monitor-private.h"
 #include "MagickCore/option.h"
+#include "MagickCore/pixel-accessor.h"
 #include "MagickCore/profile.h"
 #include "MagickCore/property.h"
 #include "MagickCore/quantum-private.h"
@@ -1809,8 +1810,7 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image,
     }
   extent=GetBytesPerRow(image->columns,image->matte != MagickFalse ? 4UL : 3UL,
     image->depth,MagickTrue);
-  if ((image_info->type != UndefinedType) &&
-      (image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
+  if ((image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
       (IsImageGray(image,exception) != MagickFalse))
     {
       quantum_type=GrayQuantum;