diff --git a/coders/tiff.c b/coders/tiff.c
index f31b630..b3c92d3 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -748,7 +748,6 @@
y;
MagickBooleanType
- associated_alpha,
debug,
status;
@@ -1055,7 +1054,6 @@
default:
break;
}
- associated_alpha=MagickFalse;
extra_samples=0;
(void) TIFFGetFieldDefaulted(tiff,TIFFTAG_EXTRASAMPLES,&extra_samples,
&sample_info);
@@ -1067,25 +1065,21 @@
else
for (i=0; i < extra_samples; i++)
{
+ image->matte=MagickTrue;
+ image->alpha_channel=UndefinedAlphaChannel;
+ (void) SetImageProperty(image,"tiff:alpha","undefined");
if (sample_info[i] == EXTRASAMPLE_UNASSALPHA)
{
- image->matte=MagickTrue;
- associated_alpha=MagickFalse;
+ image->alpha_channel=UnassociatedAlphaChannel;
+ (void) SetImageProperty(image,"tiff:alpha","unassociated");
}
if (sample_info[i] == EXTRASAMPLE_ASSOCALPHA)
{
- image->matte=MagickTrue;
- associated_alpha=MagickTrue;
+ image->alpha_channel=AssociatedAlphaChannel;
SetQuantumAlphaType(quantum_info,DisassociatedQuantumAlpha);
+ (void) SetImageProperty(image,"tiff:alpha","associated");
}
}
- option=GetImageOption(image_info,"tiff:alpha");
- if (option != (const char *) NULL)
- associated_alpha=LocaleCompare(option,"associated") == 0 ? MagickTrue :
- MagickFalse;
- if (image->matte != MagickFalse)
- (void) SetImageProperty(image,"tiff:alpha",
- associated_alpha != MagickFalse ? "associated" : "unassociated");
if ((photometric == PHOTOMETRIC_PALETTE) &&
(pow(2.0,1.0*bits_per_sample) <= MaxColormapSize))
{
@@ -1655,7 +1649,7 @@
MagickInfo
*entry;
-
+
if (tiff_semaphore == (SemaphoreInfo *) NULL)
tiff_semaphore=AllocateSemaphoreInfo();
LockSemaphoreInfo(tiff_semaphore);
diff --git a/magick/image.c b/magick/image.c
index ab3b2a3..4a6cfd9 100644
--- a/magick/image.c
+++ b/magick/image.c
@@ -828,6 +828,7 @@
clone_image->signature=MagickSignature;
clone_image->storage_class=image->storage_class;
clone_image->colorspace=image->colorspace;
+ clone_image->alpha_channel=image->alpha_channel;
clone_image->matte=image->matte;
clone_image->columns=image->columns;
clone_image->rows=image->rows;
@@ -2760,6 +2761,8 @@
break;
}
case UndefinedAlphaChannel:
+ case AssociatedAlphaChannel:
+ case UnassociatedAlphaChannel:
break;
}
return(status);
diff --git a/magick/image.h b/magick/image.h
index 50e968b..bc9fbef 100644
--- a/magick/image.h
+++ b/magick/image.h
@@ -30,6 +30,8 @@
typedef enum
{
UndefinedAlphaChannel,
+ AssociatedAlphaChannel,
+ UnassociatedAlphaChannel,
ActivateAlphaChannel,
BackgroundAlphaChannel,
CopyAlphaChannel,
@@ -333,6 +335,9 @@
MagickSizeType
extent;
+
+ AlphaChannelType
+ alpha_channel;
};
struct _ImageInfo