From 822251f39b6ae66bb88208f5737104e97726db68 Mon Sep 17 00:00:00 2001 From: cristy Date: Thu, 1 Jan 2015 00:28:58 +0000 Subject: [PATCH] http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=26816 --- coders/viff.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/coders/viff.c b/coders/viff.c index 74329a095..932a6b2d4 100644 --- a/coders/viff.c +++ b/coders/viff.c @@ -612,7 +612,11 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, for (bit=0; bit < 8; bit++) { quantum=(size_t) ((*p) & (0x01 << bit) ? 0 : 1); - SetPixelIndex(image,quantum,q); + SetPixelRed(image,quantum == 0 ? 0 : QuantumRange,q); + SetPixelGreen(image,quantum == 0 ? 0 : QuantumRange,q); + SetPixelBlue(image,quantum == 0 ? 0 : QuantumRange,q); + if (image->storage_class == PseudoClass) + SetPixelIndex(image,quantum,q); q+=GetPixelChannels(image); } p++; @@ -622,7 +626,11 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, for (bit=0; bit < (int) (image->columns % 8); bit++) { quantum=(size_t) ((*p) & (0x01 << bit) ? 0 : 1); - SetPixelIndex(image,quantum,q); + SetPixelRed(image,quantum == 0 ? 0 : QuantumRange,q); + SetPixelGreen(image,quantum == 0 ? 0 : QuantumRange,q); + SetPixelBlue(image,quantum == 0 ? 0 : QuantumRange,q); + if (image->storage_class == PseudoClass) + SetPixelIndex(image,quantum,q); q+=GetPixelChannels(image); } p++; -- 2.40.0