Skip to content

Commit

Permalink
add multispectral support to the MIFF format
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Apr 3, 2022
1 parent 101e955 commit 8fbf695
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions coders/miff.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,21 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
(void) SetImageProperty(image,keyword,options,exception);
break;
}
case 'n':
case 'N':
{
if (LocaleCompare(keyword,"number-channels") == 0)
{
image->number_channels=StringToUnsignedLong(options);
break;
}
if (LocaleCompare(keyword,"number-meta-channels") == 0)
{
image->number_meta_channels=StringToUnsignedLong(options);
break;
}
break;
}
case 'o':
case 'O':
{
Expand Down Expand Up @@ -2156,6 +2171,10 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
CommandOptionToMnemonic(MagickPixelTraitOptions,(ssize_t)
image->alpha_trait));
(void) WriteBlobString(image,buffer);
(void) FormatLocaleString(buffer,MagickPathExtent,
"number-channels=%.20g number-meta-channels=%.20g\n",
(double) image->number_channels,(double) image->number_meta_channels);
(void) WriteBlobString(image,buffer);
if (image->alpha_trait != UndefinedPixelTrait)
(void) WriteBlobString(image,"matte=True\n");
(void) FormatLocaleString(buffer,MagickPathExtent,
Expand Down

0 comments on commit 8fbf695

Please sign in to comment.