From: cristy Date: Sat, 22 May 2010 02:15:20 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9417 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61047b6d663a312ebf712a099fb334d515a2db28;p=imagemagick --- diff --git a/ChangeLog b/ChangeLog index 0ca9e3f28..b5a9b242f 100644 --- 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 * Use ScaleCharToQuantum() in coders/src.c (reference diff --git a/coders/dpx.c b/coders/dpx.c index 89e5274c6..1af6f2059 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -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); } diff --git a/magick/color-private.h b/magick/color-private.h index c3208b64b..e0a115882 100644 --- a/magick/color-private.h +++ b/magick/color-private.h @@ -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)) diff --git a/magick/quantum-private.h b/magick/quantum-private.h index 7ceaa6532..421147688 100644 --- a/magick/quantum-private.h +++ b/magick/quantum-private.h @@ -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)