diff --git a/coders/cals.c b/coders/cals.c
index 154f2d6..5f4fe63 100644
--- a/coders/cals.c
+++ b/coders/cals.c
@@ -236,6 +236,14 @@
(void) FormatMagickString(read_info->filename,MaxTextExtent,"tiff:%.1024s",
filename);
huffman_image=ReadImage(read_info,exception);
+ if (huffman_image != (Image *) NULL)
+ {
+ (void) CopyMagickString(huffman_image->filename,image_info->filename,
+ MaxTextExtent);
+ (void) CopyMagickString(huffman_image->magick_filename,
+ image_info->filename,MaxTextExtent);
+ (void) CopyMagickString(huffman_image->magick,"CALS",MaxTextExtent);
+ }
read_info=DestroyImageInfo(read_info);
(void) RelinquishUniqueFileResource(filename);
return(huffman_image);
@@ -391,13 +399,36 @@
MagickInfo
*entry;
- entry=SetMagickInfo("CALS");
+ static const char
+ *CALSDescription=
+ {
+ "Continuous Acquisition and Life-cycle Support Type 1 Image"
+ },
+ *CALSNote=
+ {
+ "Specified in MIL-R-28002 and MIL-PRF-28002"
+ };
+
+ entry=SetMagickInfo("CAL");
entry->decoder=(DecodeImageHandler *) ReadCALSImage;
+#if defined(MAGICKCORE_TIFF_DELEGATE)
entry->encoder=(EncodeImageHandler *) WriteCALSImage;
+#endif
entry->adjoin=MagickFalse;
entry->magick=(IsImageFormatHandler *) IsCALS;
- entry->description=ConstantString("Automated Interchange of Technical "
- "Information, MIL-STD-1840A");
+ entry->description=ConstantString(CALSDescription);
+ entry->note=ConstantString(CALSNote);
+ entry->module=ConstantString("CALS");
+ (void) RegisterMagickInfo(entry);
+ entry=SetMagickInfo("CALS");
+ entry->decoder=(DecodeImageHandler *) ReadCALSImage;
+#if defined(MAGICKCORE_TIFF_DELEGATE)
+ entry->encoder=(EncodeImageHandler *) WriteCALSImage;
+#endif
+ entry->adjoin=MagickFalse;
+ entry->magick=(IsImageFormatHandler *) IsCALS;
+ entry->description=ConstantString(CALSDescription);
+ entry->note=ConstantString(CALSNote);
entry->module=ConstantString("CALS");
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
@@ -424,6 +455,7 @@
*/
ModuleExport void UnregisterCALSImage(void)
{
+ (void) UnregisterMagickInfo("CAL");
(void) UnregisterMagickInfo("CALS");
}
@@ -524,6 +556,7 @@
write_info=CloneImageInfo(image_info);
SetImageInfoFile(write_info,file);
write_info->compression=Group4Compression;
+ write_info->type=BilevelType;
(void) SetImageOption(write_info,"quantum:polarity","min-is-white");
status=WriteImage(write_info,huffman_image);
(void) fflush(file);
diff --git a/coders/pdf.c b/coders/pdf.c
index 13bfb24..6234c88 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -921,6 +921,7 @@
write_info=CloneImageInfo(image_info);
SetImageInfoFile(write_info,file);
write_info->compression=Group4Compression;
+ write_info->type=BilevelType;
(void) SetImageOption(write_info,"quantum:polarity","min-is-white");
status=WriteImage(write_info,huffman_image);
(void) fflush(file);
diff --git a/coders/ps2.c b/coders/ps2.c
index 74be992..779ce67 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -250,6 +250,7 @@
write_info=CloneImageInfo(image_info);
SetImageInfoFile(write_info,file);
write_info->compression=Group4Compression;
+ write_info->type=BilevelType;
(void) SetImageOption(write_info,"quantum:polarity","min-is-white");
status=WriteImage(write_info,huffman_image);
(void) fflush(file);
diff --git a/coders/ps3.c b/coders/ps3.c
index 401a3f5..f4ef549 100644
--- a/coders/ps3.c
+++ b/coders/ps3.c
@@ -264,6 +264,7 @@
write_info=CloneImageInfo(image_info);
SetImageInfoFile(write_info,file);
write_info->compression=Group4Compression;
+ write_info->type=BilevelType;
(void) SetImageOption(write_info,"quantum:polarity","min-is-white");
status=WriteImage(write_info,huffman_image);
(void) fflush(file);
diff --git a/config/coder.xml b/config/coder.xml
index 9930c22..7d67e26 100644
--- a/config/coder.xml
+++ b/config/coder.xml
@@ -24,6 +24,7 @@
<coder magick="BRG" name="RGB"/>
<coder magick="CMYKA" name="CMYK"/>
<coder magick="C" name="RAW"/>
+ <coder magick="CAL" name="CALS"/>
<coder magick="CR2" name="DNG"/>
<coder magick="CRW" name="DNG"/>
<coder magick="CUR" name="ICON"/>
diff --git a/magick/coder.c b/magick/coder.c
index 70f77f9..a19bbe5 100644
--- a/magick/coder.c
+++ b/magick/coder.c
@@ -86,6 +86,7 @@
" <coder magick=\"BRF\" name=\"BRAILLE\" />"
" <coder magick=\"CMYKA\" name=\"CMYK\" />"
" <coder magick=\"C\" name=\"GRAY\" />"
+ " <coder magick=\"CAL\" name=\"CALS\" />"
" <coder magick=\"CR2\" name=\"DNG\" />"
" <coder magick=\"CRW\" name=\"DNG\" />"
" <coder magick=\"CUR\" name=\"ICON\" />"