Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
https://github.com/ImageMagick/ImageMagick/issues/1713
  • Loading branch information
Cristy committed Oct 3, 2019
1 parent a81ca9a commit 7db3fa2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions coders/hdr.c
Expand Up @@ -785,9 +785,13 @@ static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image,
exponent;

gamma=frexp(gamma,&exponent)*256.0/gamma;
pixel[0]=(unsigned char) (gamma*QuantumScale*GetPixelRed(image,p));
pixel[1]=(unsigned char) (gamma*QuantumScale*GetPixelGreen(image,p));
pixel[2]=(unsigned char) (gamma*QuantumScale*GetPixelBlue(image,p));
if (GetPixelRed(image,p) > 0)
pixel[0]=(unsigned char) (gamma*QuantumScale*GetPixelRed(image,p));
if (GetPixelGreen(image,p) > 0)
pixel[1]=(unsigned char) (gamma*QuantumScale*
GetPixelGreen(image,p));
if (GetPixelBlue(image,p) > 0)
pixel[2]=(unsigned char) (gamma*QuantumScale*GetPixelBlue(image,p));
pixel[3]=(unsigned char) (exponent+128);
}
if ((image->columns >= 8) && (image->columns <= 0x7ffff))
Expand Down

0 comments on commit 7db3fa2

Please sign in to comment.