13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
23ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
43ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                            SSSSS  FFFFF  W   W                              %
73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                            SS     F      W   W                              %
83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                             SSS   FFF    W   W                              %
93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                               SS  F      W W W                              %
103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                            SSSSS  F       W W                               %
113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                    Read/Write ImageMagick Image Format                      %
143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                              Software Design                                %
16de984cdc3631106b1cbbb8d3972b76a0fc27e8e8cristy%                                   Cristy                                    %
173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                 July 1992                                   %
183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
207ce65e7125a4e1df1a274ce373c537a9df9c16cdCristy%  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization      %
213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  dedicated to making software imaging solutions freely available.           %
223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  You may not use this file except in compliance with the License.  You may  %
243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  obtain a copy of the License at                                            %
253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    http://www.imagemagick.org/script/license.php                            %
273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  Unless required by applicable law or agreed to in writing, software        %
293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  distributed under the License is distributed on an "AS IS" BASIS,          %
303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  See the License for the specific language governing permissions and        %
323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  limitations under the License.                                             %
333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  Include declarations.
413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
424c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/studio.h"
434c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/blob.h"
444c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/blob-private.h"
454c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/constitute.h"
464c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/exception.h"
474c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/exception-private.h"
484c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/image.h"
494c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/image-private.h"
504c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/list.h"
514c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/magick.h"
524c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/memory_.h"
534c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/resource_.h"
544c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/quantum-private.h"
554c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/static.h"
564c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/string_.h"
574c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/module.h"
584c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/transform.h"
594c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/utility.h"
6018c6c27bc513a8c73a5bc4a2c157afb19c3e24b9cristy#include "MagickCore/utility-private.h"
613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%   I s S F W                                                                 %
683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  IsSFW() returns MagickTrue if the image format type, identified by the
743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  magick string, is SFW.
753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  The format of the IsSFW method is:
773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%      MagickBooleanType IsSFW(const unsigned char *magick,const size_t length)
793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  A description of each parameter follows:
813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o magick: compare image format pattern against these bytes.
833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o length: Specifies the length of the magick string.
853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
873ed852eea50f9d4cd633efb8c2b054b8e33c253cristystatic MagickBooleanType IsSFW(const unsigned char *magick,const size_t length)
883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (length < 5)
903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    return(MagickFalse);
913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (LocaleNCompare((const char *) magick,"SFW94",5) == 0)
923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    return(MagickTrue);
933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return(MagickFalse);
943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%   R e a d S F W I m a g e                                                   %
1023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
1053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  ReadSFWImage() reads a Seattle Film Works image file and returns it.
1083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  It allocates the memory necessary for the new Image structure and returns a
1093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  pointer to the new image.
1103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  The format of the ReadSFWImage method is:
1123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%      Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception)
1143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  A description of each parameter follows:
1163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o image_info: the image info.
1183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o exception: return any errors or warnings in this structure.
1203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
1213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
1223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12306beaa808eb4effbfd9991c110e8c848642231c7cristystatic unsigned char *SFWScan(const unsigned char *p,const unsigned char *q,
12416881e68c6165c6191fc44151a8a4320e3dd1ffdcristy  const unsigned char *target,const size_t length)
1253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
126bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  register ssize_t
1273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    i;
1283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12906beaa808eb4effbfd9991c110e8c848642231c7cristy  if ((p+length) < q)
13006beaa808eb4effbfd9991c110e8c848642231c7cristy    while (p < q)
13106beaa808eb4effbfd9991c110e8c848642231c7cristy    {
1322545d86df0b273af4ac929eb3240c11057517eeccristy      for (i=0; i < (ssize_t) length; i++)
13306beaa808eb4effbfd9991c110e8c848642231c7cristy        if (p[i] != target[i])
13406beaa808eb4effbfd9991c110e8c848642231c7cristy          break;
1352545d86df0b273af4ac929eb3240c11057517eeccristy      if (i == (ssize_t) length)
13606beaa808eb4effbfd9991c110e8c848642231c7cristy        return((unsigned char *) p);
13706beaa808eb4effbfd9991c110e8c848642231c7cristy      p++;
13806beaa808eb4effbfd9991c110e8c848642231c7cristy    }
1393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return((unsigned char *) NULL);
1403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1423ed852eea50f9d4cd633efb8c2b054b8e33c253cristystatic void TranslateSFWMarker(unsigned char *marker)
1433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
1443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  switch (marker[1])
1453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  {
1463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    case 0xc8: marker[1]=0xd8; break;  /* soi */
1473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    case 0xd0: marker[1]=0xe0; break;  /* app */
1483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    case 0xcb: marker[1]=0xdb; break;  /* dqt */
1493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    case 0xa0: marker[1]=0xc0; break;  /* sof */
1503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    case 0xa4: marker[1]=0xc4; break;  /* sof */
1513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    case 0xca: marker[1]=0xda; break;  /* sos */
1523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    case 0xc9: marker[1]=0xd9; break;  /* eoi */
1533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    default: break;
1543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  }
1553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1573ed852eea50f9d4cd633efb8c2b054b8e33c253cristystatic Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception)
1583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
1593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  static unsigned char
1603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    HuffmanTable[] =
1613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
1623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xFF, 0xC4, 0x01, 0xA2, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01,
1633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
1653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
1663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04,
1673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x10, 0x00, 0x02, 0x01,
1683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00,
1693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x01, 0x7D, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21,
1703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32,
1713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x81, 0x91, 0xA1, 0x08, 0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1,
1723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xF0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16, 0x17, 0x18,
1733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x19, 0x1A, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x34, 0x35, 0x36,
1743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
1753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x63, 0x64,
1763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73, 0x74, 0x75, 0x76, 0x77,
1773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x78, 0x79, 0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A,
1783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0xA2, 0xA3,
1793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5,
1803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
1813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9,
1823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xDA, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA,
1833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0x11,
1843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04,
1853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04,
1863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13,
1873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xA1, 0xB1, 0xC1, 0x09,
1883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x23, 0x33, 0x52, 0xF0, 0x15, 0x62, 0x72, 0xD1, 0x0A, 0x16, 0x24,
1893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x34, 0xE1, 0x25, 0xF1, 0x17, 0x18, 0x19, 0x1A, 0x26, 0x27, 0x28,
1903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x29, 0x2A, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x43, 0x44, 0x45,
1913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x46, 0x47, 0x48, 0x49, 0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
1923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x59, 0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x73,
1933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x82, 0x83, 0x84, 0x85,
1943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x86, 0x87, 0x88, 0x89, 0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
1953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0x98, 0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9,
1963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xC2,
1973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4,
1983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,
1993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xE7, 0xE8, 0xE9, 0xEA, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8,
2003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      0xF9, 0xFA
2013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    };
2023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  FILE
2043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *file;
2053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  Image
2073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *flipped_image,
20816881e68c6165c6191fc44151a8a4320e3dd1ffdcristy    *jpeg_image,
2093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *image;
2103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ImageInfo
2123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *read_info;
2133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  int
2153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    unique_file;
2163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  MagickBooleanType
2183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    status;
2193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  register unsigned char
2213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *header,
2223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *data;
2233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
22495236b5197310e4ca467d8585545bbd77edddc53cristy  size_t
22595236b5197310e4ca467d8585545bbd77edddc53cristy    extent;
22695236b5197310e4ca467d8585545bbd77edddc53cristy
2273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ssize_t
2283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    count;
2293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  unsigned char
2313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *buffer,
2323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *offset;
2333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
2353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Open image file.
2363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
2373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  assert(image_info != (const ImageInfo *) NULL);
238e1c94d9d25db6b0dd7a5028ffee31d1057855d73cristy  assert(image_info->signature == MagickCoreSignature);
2393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image_info->debug != MagickFalse)
2403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
2413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image_info->filename);
2423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  assert(exception != (ExceptionInfo *) NULL);
243e1c94d9d25db6b0dd7a5028ffee31d1057855d73cristy  assert(exception->signature == MagickCoreSignature);
2449950d57e1124b73f684fb5946e206994cefda628cristy  image=AcquireImage(image_info,exception);
2453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
2463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (status == MagickFalse)
2473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
2483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image=DestroyImageList(image);
2493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      return((Image *) NULL);
2503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
2513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
2523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Read image into a buffer.
2533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
25416881e68c6165c6191fc44151a8a4320e3dd1ffdcristy  if (GetBlobSize(image) != (size_t) GetBlobSize(image))
25516881e68c6165c6191fc44151a8a4320e3dd1ffdcristy    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
2563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  buffer=(unsigned char *) AcquireQuantumMemory((size_t) GetBlobSize(image),
2573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    sizeof(*buffer));
2583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (buffer == (unsigned char *) NULL)
2593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
2603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  count=ReadBlob(image,(size_t) GetBlobSize(image),buffer);
26116881e68c6165c6191fc44151a8a4320e3dd1ffdcristy  if ((count != (ssize_t) GetBlobSize(image)) ||
26216881e68c6165c6191fc44151a8a4320e3dd1ffdcristy      (LocaleNCompare((char *) buffer,"SFW",3) != 0))
2633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
2643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) CloseBlob(image);
2653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
2663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Find the start of the JFIF data
2673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
2683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  header=SFWScan(buffer,buffer+count-1,(const unsigned char *)
2693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "\377\310\377\320",4);
2703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (header == (unsigned char *) NULL)
2713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
2723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      buffer=(unsigned char *) RelinquishMagickMemory(buffer);
2733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      ThrowReaderException(CorruptImageError,"ImproperImageHeader");
2743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
2753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  TranslateSFWMarker(header);  /* translate soi and app tags */
2763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  TranslateSFWMarker(header+2);
2773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) CopyMagickMemory(header+6,"JFIF\0\001\0",7);  /* JFIF magic */
2783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
2793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Translate remaining markers.
2803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
2813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  offset=header+2;
28206beaa808eb4effbfd9991c110e8c848642231c7cristy  offset+=(((unsigned int) offset[2]) << 8)+offset[3]+2;
2833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  for ( ; ; )
2843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  {
28506beaa808eb4effbfd9991c110e8c848642231c7cristy    if ((offset+4) > (buffer+count-1))
28606beaa808eb4effbfd9991c110e8c848642231c7cristy      {
28706beaa808eb4effbfd9991c110e8c848642231c7cristy        buffer=(unsigned char *) RelinquishMagickMemory(buffer);
28806beaa808eb4effbfd9991c110e8c848642231c7cristy        ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
28906beaa808eb4effbfd9991c110e8c848642231c7cristy      }
2903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    TranslateSFWMarker(offset);
2913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if (offset[1] == 0xda)
2923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      break;
29306beaa808eb4effbfd9991c110e8c848642231c7cristy    offset+=(((unsigned int) offset[2]) << 8)+offset[3]+2;
2943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  }
2953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  offset--;
2963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  data=SFWScan(offset,buffer+count-1,(const unsigned char *) "\377\311",2);
2973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (data == (unsigned char *) NULL)
2983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
2993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      buffer=(unsigned char *) RelinquishMagickMemory(buffer);
3003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      ThrowReaderException(CorruptImageError,"ImproperImageHeader");
3013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
3023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  TranslateSFWMarker(data++);  /* translate eoi marker */
3033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
3043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Write JFIF file.
3053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
3063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  read_info=CloneImageInfo(image_info);
30798f91ec7f3fedcd2975966146eb8e396d4c59addcristy  SetImageInfoBlob(read_info,(void *) NULL,0);
3083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  file=(FILE *) NULL;
3093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  unique_file=AcquireUniqueFileResource(read_info->filename);
3103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (unique_file != -1)
31118c6c27bc513a8c73a5bc4a2c157afb19c3e24b9cristy    file=fopen_utf8(read_info->filename,"wb");
3123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((unique_file == -1) || (file == (FILE *) NULL))
3133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
3143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      buffer=(unsigned char *) RelinquishMagickMemory(buffer);
3153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      read_info=DestroyImageInfo(read_info);
3163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (void) CopyMagickString(image->filename,read_info->filename,
317151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy        MagickPathExtent);
3183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      ThrowFileException(exception,FileOpenError,"UnableToCreateTemporaryFile",
3193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        image->filename);
3203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image=DestroyImageList(image);
3213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      return((Image *) NULL);
3223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
32395236b5197310e4ca467d8585545bbd77edddc53cristy  extent=fwrite(header,(size_t) (offset-header+1),1,file);
324da16f16767eb31921af855f17bda465fffc4e000cristy  (void) extent;
32595236b5197310e4ca467d8585545bbd77edddc53cristy  extent=fwrite(HuffmanTable,1,sizeof(HuffmanTable)/sizeof(*HuffmanTable),file);
32695236b5197310e4ca467d8585545bbd77edddc53cristy  extent=fwrite(offset+1,(size_t) (data-offset),1,file);
3273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  status=ferror(file) == -1 ? MagickFalse : MagickTrue;
3283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) fclose(file);
329100a056069d5718f995e95a77950dcae6f412ff4cristy  (void) close(unique_file);
3303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  buffer=(unsigned char *) RelinquishMagickMemory(buffer);
3313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (status == MagickFalse)
3323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
3333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      char
3343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        *message;
3353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
33618c6c27bc513a8c73a5bc4a2c157afb19c3e24b9cristy      (void) remove_utf8(read_info->filename);
3373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      read_info=DestroyImageInfo(read_info);
3383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      message=GetExceptionMessage(errno);
339c82a27bb8e3138ff9bbf0f696663bdf3e704cedecristy      (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
340c82a27bb8e3138ff9bbf0f696663bdf3e704cedecristy        "UnableToWriteFile","`%s': %s",image->filename,message);
3413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      message=DestroyString(message);
3423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      image=DestroyImageList(image);
3433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      return((Image *) NULL);
3443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
3453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
3463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Read JPEG image.
3473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
34816881e68c6165c6191fc44151a8a4320e3dd1ffdcristy  jpeg_image=ReadImage(read_info,exception);
3493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) RelinquishUniqueFileResource(read_info->filename);
3503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  read_info=DestroyImageInfo(read_info);
35116881e68c6165c6191fc44151a8a4320e3dd1ffdcristy  if (jpeg_image == (Image *) NULL)
35216881e68c6165c6191fc44151a8a4320e3dd1ffdcristy    {
35316881e68c6165c6191fc44151a8a4320e3dd1ffdcristy      image=DestroyImageList(image);
35416881e68c6165c6191fc44151a8a4320e3dd1ffdcristy      return(jpeg_image);
35516881e68c6165c6191fc44151a8a4320e3dd1ffdcristy    }
356151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy  (void) CopyMagickString(jpeg_image->filename,image->filename,MagickPathExtent);
357151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy  (void) CopyMagickString(jpeg_image->magick,image->magick,MagickPathExtent);
35816881e68c6165c6191fc44151a8a4320e3dd1ffdcristy  image=DestroyImageList(image);
35916881e68c6165c6191fc44151a8a4320e3dd1ffdcristy  image=jpeg_image;
3603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
3613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Correct image orientation.
3623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
3633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  flipped_image=FlipImage(image,exception);
364bbfd4cd2bb2c9d59a20738b8cefce4c12307722dcristy  if (flipped_image != (Image *) NULL)
365bbfd4cd2bb2c9d59a20738b8cefce4c12307722dcristy    {
366bbfd4cd2bb2c9d59a20738b8cefce4c12307722dcristy      DuplicateBlob(flipped_image,image);
367bbfd4cd2bb2c9d59a20738b8cefce4c12307722dcristy      image=DestroyImage(image);
368bbfd4cd2bb2c9d59a20738b8cefce4c12307722dcristy      image=flipped_image;
369bbfd4cd2bb2c9d59a20738b8cefce4c12307722dcristy    }
370bbfd4cd2bb2c9d59a20738b8cefce4c12307722dcristy  return(GetFirstImageInList(image));
3713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
3743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
3763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
3773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
3783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%   R e g i s t e r S F W I m a g e                                           %
3793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
3803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
3813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
3823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
3843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  RegisterSFWImage() adds attributes for the SFW image format to
3853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  the list of supported formats.  The attributes include the image format
3863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  tag, a method to read and/or write the format, whether the format
3873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  supports the saving of more than one frame to the same file or blob,
3883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  whether the format supports native in-memory I/O, and a brief
3893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  description of the format.
3903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
3913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  The format of the RegisterSFWImage method is:
3923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
393bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy%      size_t RegisterSFWImage(void)
3943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
3953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
396bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristyModuleExport size_t RegisterSFWImage(void)
3973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
3983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  MagickInfo
3993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *entry;
4003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
40106b627a07ff44e1ff93ef1288c9f428066ded10ddirk  entry=AcquireMagickInfo("SFW","SFW","Seattle Film Works");
4023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  entry->decoder=(DecodeImageHandler *) ReadSFWImage;
4033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  entry->magick=(IsImageFormatHandler *) IsSFW;
40408e9a113db499034abb5ad8d59b42f8eca3c641cdirk  entry->flags^=CoderAdjoinFlag;
4053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) RegisterMagickInfo(entry);
4063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return(MagickImageCoderSignature);
4073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
4103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
4123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
4133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
4143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%   U n r e g i s t e r S F W I m a g e                                       %
4153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
4163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
4173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
4183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
4203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  UnregisterSFWImage() removes format registrations made by the
4213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  SFW module from the list of supported formats.
4223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
4233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  The format of the UnregisterSFWImage method is:
4243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
4253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%      UnregisterSFWImage(void)
4263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
4273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
4283ed852eea50f9d4cd633efb8c2b054b8e33c253cristyModuleExport void UnregisterSFWImage(void)
4293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
4303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) UnregisterMagickInfo("SFW");
4313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
432