]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 22 May 2010 02:15:20 +0000 (02:15 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 22 May 2010 02:15:20 +0000 (02:15 +0000)
ChangeLog
coders/dpx.c
magick/color-private.h
magick/quantum-private.h

index 0ca9e3f28beb0ce55a479f3830e5ac95556e19ef..b5a9b242faef149126de5fba8913856329b66561 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@
   * Add context to -border for montage.  Inside the parenthesis it adds a border
     to the image otherwise it sets the border for the layout manager.
   * 24-bit BMP images are not colormapped even if header colors != 0.
+  * Set DPX user data like this: -set profile dpx:userdata.txt.
 
 2010-05-15  6.6.1-10 Cristy  <quetzlzacatenango@image...>
   * Use ScaleCharToQuantum() in coders/src.c (reference
index 89e5274c6f9f7c4338bdbd2b1fd092ff2d3e53cc..1af6f2059a700d4509a4b229a2750853e48a2dc7 100644 (file)
@@ -988,7 +988,7 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
            profile=AcquireStringInfo(dpx.file.user_size-sizeof(dpx.user.id));
            offset+=ReadBlob(image,GetStringInfoLength(profile),
              GetStringInfoDatum(profile));
-           (void) SetImageProfile(image,"dpx:user.data",profile);
+           (void) SetImageProfile(image,"dpx",profile);
            profile=DestroyStringInfo(profile);
         }
     }
@@ -1371,9 +1371,11 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image)
   dpx.file.magic=0x53445058U;
   offset+=WriteBlobLong(image,dpx.file.magic);
   dpx.file.image_offset=0x2000U;
-  profile=GetImageProfile(image,"dpx:user.data");
+  profile=GetImageProfile(image,"dpx");
   if (profile != (StringInfo *) NULL)
     {
+      if (GetStringInfoLength(profile) > 1048576)
+        ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
       dpx.file.image_offset+=(unsigned int) GetStringInfoLength(profile);
       dpx.file.image_offset=(((dpx.file.image_offset+0x2000-1)/0x2000)*0x2000);
     }
index c3208b64b17348b3b078592aa41cf07dfae9960a..e0a115882a8bfc3db20fbe60852dde1e3f84e769 100644 (file)
@@ -148,12 +148,7 @@ static inline Quantum PixelIntensityToQuantum(const PixelPacket *pixel)
 #if !defined(MAGICKCORE_HDRI_SUPPORT)
   if ((pixel->red == pixel->green) && (pixel->green == pixel->blue))
     return(pixel->red);
-#if (MAGICKCORE_QUANTUM_DEPTH <= 16)
-  return((Quantum) ((306U*(unsigned int) pixel->red+
-    601U*(unsigned int) pixel->green+117U*(unsigned int) pixel->blue) >> 10U));
-#else
   return((Quantum) (0.299*pixel->red+0.587*pixel->green+0.114*pixel->blue+0.5));
-#endif
 #else
   if ((fabs(pixel->red-pixel->green) <= MagickEpsilon) &&
       (fabs(pixel->green-pixel->blue) <= MagickEpsilon))
index 7ceaa653218deac5bf7f2017534ec18f2cf2114d..42114768802ca5d33f06d5d30cd6c6ed172b9169 100644 (file)
@@ -312,7 +312,7 @@ static inline Quantum ScaleAnyToQuantum(const QuantumAny quantum,
 static inline QuantumAny ScaleQuantumToAny(const Quantum quantum,
   const QuantumAny range)
 {
-  return((QuantumAny) (((MagickRealType) range*quantum)/QuantumRange+0.5));
+  return((QuantumAny) (((MagickRealType) range*quantum)/QuantumRange)+0.5);
 }
 
 #if (MAGICKCORE_QUANTUM_DEPTH == 8)