Changeset 380

Show
Ignore:
Timestamp:
10/15/09 11:41:54 (5 months ago)
Author:
cristy
Message:
 
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • ImageMagick/trunk/config/magic.xml

    r1 r380  
    77<!ATTLIST magic target CDATA #REQUIRED> 
    88]> 
     9<!-- 
     10  Associate an image format with a unique identifier.  
     11 
     12  Many image formats have identifiers that uniquely identify a particular 
     13  image format. For example, the GIF image format always begins with GIF8 
     14  as the first 4 characters of the image. ImageMagick uses this information 
     15  to quickly determine the type of image it is dealing with when it reads 
     16  an image. 
     17--> 
    918<magicmap> 
    10   <magic name="AVI" offset="0" target="RIFF"/> 
    11   <magic name="8BIMWTEXT" offset="0" target="8\000B\000I\000M\000#"/> 
    12   <magic name="8BIMTEXT" offset="0" target="8BIM#"/> 
    13   <magic name="8BIM" offset="0" target="8BIM"/> 
    14   <magic name="BMP" offset="0" target="BA"/> 
    15   <magic name="BMP" offset="0" target="BM"/> 
    16   <magic name="BMP" offset="0" target="CI"/> 
    17   <magic name="BMP" offset="0" target="CP"/> 
    18   <magic name="BMP" offset="0" target="IC"/> 
    19   <magic name="BMP" offset="0" target="PI"/> 
    20   <magic name="CGM" offset="0" target="BEGMF"/> 
    21   <magic name="CIN" offset="0" target="\200\052\137\327"/> 
    22   <magic name="CRW" offset="0" target="II\x1a\x00\x00\x00HEAPCCDR"/> 
    23   <magic name="DCM" offset="128" target="DICM"/> 
    24   <magic name="DCX" offset="0" target="\261\150\336\72"/> 
    25   <magic name="DDS" offset="0" target="DDS "/> 
    26   <magic name="DIB" offset="0" target="\050\000"/> 
    27   <magic name="DJVU" offset="0" target="AT&amp;TFORM"/> 
    28   <magic name="DOT" offset="0" target="digraph"/> 
    29   <magic name="DPX" offset="0" target="SDPX"/> 
    30   <magic name="DPX" offset="0" target="XPDS"/> 
    31   <magic name="EMF" offset="40" target="\040\105\115\106\000\000\001\000"/> 
    32   <magic name="EPT" offset="0" target="\305\320\323\306"/> 
    33   <magic name="EXR" offset="0" target="\166\057\061\001"/> 
    34   <magic name="FAX" offset="0" target="DFAX"/> 
    35   <magic name="FIG" offset="0" target="#FIG"/> 
    36   <magic name="FITS" offset="0" target="IT0"/> 
    37   <magic name="FITS" offset="0" target="SIMPLE"/> 
    38   <magic name="FPX" offset="0" target="\320\317\021\340"/> 
    39   <magic name="GIF" offset="0" target="GIF8"/> 
    40   <magic name="GPLT" offset="0" target="#!/usr/local/bin/gnuplot"/> 
    41   <magic name="HDF" offset="1" target="HDF"/> 
    42   <magic name="HPGL" offset="0" target="IN;"/> 
    43   <magic name="HTML" offset="1" target="HTML"/> 
    44   <magic name="HTML" offset="1" target="html"/> 
    45   <magic name="ILBM" offset="8" target="ILBM"/> 
    46   <magic name="IPTCWTEXT" offset="0" target="\062\000#\000\060\000=\000\042\000&amp;\000#\000\060\000;\000&amp;\000#\000\062\000;\000\042\000"/> 
    47   <magic name="IPTCTEXT" offset="0" target="2#0=\042&amp;#0;&amp;#2;\042"/> 
    48   <magic name="IPTC" offset="0" target="\034\002"/> 
    49   <magic name="JNG" offset="0" target="\213JNG\r\n\032\n"/> 
    50   <magic name="JPEG" offset="0" target="\377\330\377"/> 
    51   <magic name="JPC" offset="0" target="\377\117"/> 
    52   <magic name="JP2" offset="4" target="\152\120\040\040\015"/> 
    53   <magic name="MIFF" offset="0" target="Id=ImageMagick"/> 
    54   <magic name="MIFF" offset="0" target="id=ImageMagick"/> 
    55   <magic name="MNG" offset="0" target="\212MNG\r\n\032\n"/> 
    56   <magic name="MPC" offset="0" target="id=MagickCache"/> 
    57   <magic name="MPEG" offset="0" target="\000\000\001\263"/> 
    58   <magic name="MRW" offset="0" target="\x00MRM"/> 
    59   <magic name="MVG" offset="0" target="push graphic-context"/> 
    60   <magic name="ORF" offset="0" target="IIRO\x08\x00\x00\x00"/> 
    61   <magic name="PCD" offset="2048" target="PCD_"/> 
    62   <magic name="PCL" offset="0" target="\033E\033"/> 
    63   <magic name="PCX" offset="0" target="\012\002"/> 
    64   <magic name="PCX" offset="0" target="\012\005"/> 
    65   <magic name="PDB" offset="60" target="vIMGView"/> 
    66   <magic name="PDF" offset="0" target="%PDF-"/> 
    67   <magic name="PFA" offset="0" target="%!PS-AdobeFont-1.0"/> 
    68   <magic name="PFB" offset="6" target="%!PS-AdobeFont-1.0"/> 
    69   <magic name="PGX" offset="0" target="\050\107\020\115\046"/> 
    70   <magic name="PICT" offset="522" target="\000\021\002\377\014\000"/> 
    71   <magic name="PNG" offset="0" target="\211PNG\r\n\032\n"/> 
    72   <magic name="PNM" offset="0" target="P1"/> 
    73   <magic name="PNM" offset="0" target="P2"/> 
    74   <magic name="PNM" offset="0" target="P3"/> 
    75   <magic name="PNM" offset="0" target="P4"/> 
    76   <magic name="PNM" offset="0" target="P5"/> 
    77   <magic name="PNM" offset="0" target="P6"/> 
    78   <magic name="PNM" offset="0" target="P7"/> 
    79   <magic name="PNM" offset="0" target="PF"/> 
    80   <magic name="PNM" offset="0" target="Pf"/> 
    81   <magic name="PS" offset="0" target="%!"/> 
    82   <magic name="PS" offset="0" target="\004%!"/> 
    83   <magic name="PS" offset="0" target="\305\320\323\306"/> 
    84   <magic name="PSD" offset="0" target="8BPS"/> 
    85   <magic name="PWP" offset="0" target="SFW95"/> 
    86   <magic name="RAD" offset="0" target="#?RADIANCE"/> 
    87   <magic name="RAD" offset="0" target="VIEW= "/> 
    88   <magic name="RAF" offset="0" target="FUJIFILMCCD-RAW "/> 
    89   <magic name="RLE" offset="0" target="\122\314"/> 
    90   <magic name="SCT" offset="0" target="CT"/> 
    91   <magic name="SFW" offset="0" target="SFW94"/> 
    92   <magic name="SGI" offset="0" target="\001\332"/> 
    93   <magic name="SUN" offset="0" target="\131\246\152\225"/> 
    94   <magic name="SVG" offset="1" target="?XML"/> 
    95   <magic name="SVG" offset="1" target="?xml"/> 
    96   <magic name="TXT" offset="0" target="# ImageMagick pixel enumeration:"/> 
    97   <magic name="TIFF" offset="0" target="\115\115\000\052"/> 
    98   <magic name="TIFF" offset="0" target="\111\111\052\000"/> 
    99   <magic name="TIFF64" offset="0" target="\115\115\000\053\000\010\000\000"/> 
    100   <magic name="TIFF64" offset="0" target="\111\111\053\000\010\000\000\000"/> 
    101   <magic name="VICAR" offset="0" target="LBLSIZE"/> 
    102   <magic name="VICAR" offset="0" target="NJPL1I"/> 
    103   <magic name="VIFF" offset="0" target="\253\001"/> 
    104   <magic name="WMF" offset="0" target="\327\315\306\232"/> 
    105   <magic name="WMF" offset="0" target="\001\000\011\000"/> 
    106   <magic name="WPG" offset="0" target="\377WPC"/> 
    107   <magic name="XBM" offset="0" target="#define"/> 
    108   <magic name="XCF" offset="0" target="gimp xcf"/> 
    109   <magic name="XPM" offset="1" target="* XPM *"/> 
    110   <magic name="XWD" offset="4" target="\007\000\000"/> 
    111   <magic name="XWD" offset="5" target="\000\000\007"/> 
    112   <magic name="XEF" offset="0" target="FOVb"/> 
     19  <!-- <magic name="GIF" offset="0" target="GIF8"/> --> 
     20  <!-- <magic name="JPEG" offset="0" target="\377\330\377"/> --> 
     21  <!-- <magic name="PNG" offset="0" target="\211PNG\r\n\032\n"/> --> 
     22  <!-- <magic name="TIFF" offset="0" target="\115\115\000\052"/> --> 
    11323</magicmap> 
  • ImageMagick/trunk/config/policy.xml

    r1 r380  
    1010]> 
    1111<!-- 
    12   ImageMagick policies. 
     12  Configure ImageMagick policies. 
    1313 
    1414  Domains include delegate, coder, filter, path, or resource. 
  • ImageMagick/trunk/magick/magic.c

    r324 r380  
    6262  Static declarations. 
    6363*/ 
    64 static const char 
    65   *MagicMap = (const char *) 
    66     "<?xml version=\"1.0\"?>" 
    67     "<magicmap>" 
    68     "  <magic name=\"AVI\" offset=\"0\" target=\"RIFF\" />" 
    69     "  <magic name=\"8BIMWTEXT\" offset=\"0\" target=\"8\\000B\\000I\\000M\\000#\" />" 
    70     "  <magic name=\"8BIMTEXT\" offset=\"0\" target=\"8BIM#\" />" 
    71     "  <magic name=\"8BIM\" offset=\"0\" target=\"8BIM\" />" 
    72     "  <magic name=\"BMP\" offset=\"0\" target=\"BA\" />" 
    73     "  <magic name=\"BMP\" offset=\"0\" target=\"BM\" />" 
    74     "  <magic name=\"BMP\" offset=\"0\" target=\"CI\" />" 
    75     "  <magic name=\"BMP\" offset=\"0\" target=\"CP\" />" 
    76     "  <magic name=\"BMP\" offset=\"0\" target=\"IC\" />" 
    77     "  <magic name=\"BMP\" offset=\"0\" target=\"PI\" />" 
    78     "  <magic name=\"CIN\" offset=\"0\" target=\"\\200\\052\\137\\327\" />" 
    79     "  <magic name=\"CGM\" offset=\"0\" target=\"BEGMF\" />" 
    80     "  <magic name=\"DCM\" offset=\"128\" target=\"DICM\" />" 
    81     "  <magic name=\"DCX\" offset=\"0\" target=\"\\261\\150\\336\\72\" />" 
    82     "  <magic name=\"DDS\" offset=\"0\" target=\"DDS \" />" 
    83     "  <magic name=\"DIB\" offset=\"0\" target=\"\\050\\000\" />" 
    84     "  <magic name=\"DJVU\" offset=\"0\" target=\"AT&TFORM\" />" 
    85     "  <magic name=\"DOT\" offset=\"0\" target=\"digraph\" />" 
    86     "  <magic name=\"DPX\" offset=\"0\" target=\"SDPX\" />" 
    87     "  <magic name=\"DPX\" offset=\"0\" target=\"XPDS\" />" 
    88     "  <magic name=\"EMF\" offset=\"40\" target=\"\\040\\105\\115\\106\\000\\000\\001\\000\" />" 
    89     "  <magic name=\"EPT\" offset=\"0\" target=\"\\305\\320\\323\\306\" />" 
    90     "  <magic name=\"EXR\" offset=\"0\" target=\"\\166\\057\\061\\001\" />" 
    91     "  <magic name=\"FAX\" offset=\"0\" target=\"DFAX\" />" 
    92     "  <magic name=\"FIG\" offset=\"0\" target=\"#FIG\" />" 
    93     "  <magic name=\"FITS\" offset=\"0\" target=\"IT0\" />" 
    94     "  <magic name=\"FITS\" offset=\"0\" target=\"SIMPLE\" />" 
    95     "  <magic name=\"FPX\" offset=\"0\" target=\"\\320\\317\\021\\340\" />" 
    96     "  <magic name=\"GIF\" offset=\"0\" target=\"GIF8\" />" 
    97     "  <magic name=\"GPLT\" offset=\"0\" target=\"#!/usr/local/bin/gnuplot\" />" 
    98     "  <magic name=\"HDF\" offset=\"1\" target=\"HDF\" />" 
    99     "  <magic name=\"HPGL\" offset=\"0\" target=\"IN;\" />" 
    100     "  <magic name=\"HTML\" offset=\"1\" target=\"HTML\" />" 
    101     "  <magic name=\"HTML\" offset=\"1\" target=\"html\" />" 
    102     "  <magic name=\"ILBM\" offset=\"8\" target=\"ILBM\" />" 
    103     "  <magic name=\"IPTCWTEXT\" offset=\"0\" target=\"\\062\\000#\\000\\060\\000=\\000\\042\\000&\\000#\\000\\060\\000;\\000&\\000#\\000\\062\\000;\\000\\042\\000\" />" 
    104     "  <magic name=\"IPTCTEXT\" offset=\"0\" target=\"2#0=\\042&#0;&#2;\\042\" />" 
    105     "  <magic name=\"IPTC\" offset=\"0\" target=\"\\034\\002\" />" 
    106     "  <magic name=\"JNG\" offset=\"0\" target=\"\\213JNG\\r\\n\\032\\n\" />" 
    107     "  <magic name=\"JPEG\" offset=\"0\" target=\"\\377\\330\\377\" />" 
    108     "  <magic name=\"JPC\" offset=\"0\" target=\"\\377\\117\" />" 
    109     "  <magic name=\"JP2\" offset=\"4\" target=\"\\152\\120\\040\\040\\015\" />" 
    110     "  <magic name=\"MIFF\" offset=\"0\" target=\"Id=ImageMagick\" />" 
    111     "  <magic name=\"MIFF\" offset=\"0\" target=\"id=ImageMagick\" />" 
    112     "  <magic name=\"MNG\" offset=\"0\" target=\"\\212MNG\\r\\n\\032\\n\" />" 
    113     "  <magic name=\"MPC\" offset=\"0\" target=\"id=MagickCache\" />" 
    114     "  <magic name=\"MPEG\" offset=\"0\" target=\"\\000\\000\\001\\263\" />" 
    115     "  <magic name=\"MVG\" offset=\"0\" target=\"push graphic-context\" />" 
    116     "  <magic name=\"PCD\" offset=\"2048\" target=\"PCD_\" />" 
    117     "  <magic name=\"PCL\" offset=\"0\" target=\"\\033E\\033\" />" 
    118     "  <magic name=\"PCX\" offset=\"0\" target=\"\\012\\002\" />" 
    119     "  <magic name=\"PCX\" offset=\"0\" target=\"\\012\\005\" />" 
    120     "  <magic name=\"PDB\" offset=\"60\" target=\"vIMGView\" />" 
    121     "  <magic name=\"PDF\" offset=\"0\" target=\"%PDF-\" />" 
    122     "  <magic name=\"PFA\" offset=\"0\" target=\"%!PS-AdobeFont-1.0\" />" 
    123     "  <magic name=\"PFB\" offset=\"6\" target=\"%!PS-AdobeFont-1.0\" />" 
    124     "  <magic name=\"PGX\" offset=\"0\" target=\"\\050\\107\\020\\115\\046\" />" 
    125     "  <magic name=\"PICT\" offset=\"522\" target=\"\\000\\021\\002\\377\\014\\000\" />" 
    126     "  <magic name=\"PNG\" offset=\"0\" target=\"\\211PNG\\r\\n\\032\\n\" />" 
    127     "  <magic name=\"PNM\" offset=\"0\" target=\"P1\" />" 
    128     "  <magic name=\"PNM\" offset=\"0\" target=\"P2\" />" 
    129     "  <magic name=\"PNM\" offset=\"0\" target=\"P3\" />" 
    130     "  <magic name=\"PNM\" offset=\"0\" target=\"P4\" />" 
    131     "  <magic name=\"PNM\" offset=\"0\" target=\"P5\" />" 
    132     "  <magic name=\"PNM\" offset=\"0\" target=\"P6\" />" 
    133     "  <magic name=\"PNM\" offset=\"0\" target=\"P7\" />" 
    134     "  <magic name=\"PNM\" offset=\"0\" target=\"PF\" />" 
    135     "  <magic name=\"PNM\" offset=\"0\" target=\"Pf\" />" 
    136     "  <magic name=\"PS\" offset=\"0\" target=\"%!\" />" 
    137     "  <magic name=\"PS\" offset=\"0\" target=\"\\004%!\" />" 
    138     "  <magic name=\"PS\" offset=\"0\" target=\"\\305\\320\\323\\306\" />" 
    139     "  <magic name=\"PSD\" offset=\"0\" target=\"8BPS\" />" 
    140     "  <magic name=\"PWP\" offset=\"0\" target=\"SFW95\" />" 
    141     "  <magic name=\"RAD\" offset=\"0\" target=\"#?RADIANCE\" />" 
    142     "  <magic name=\"RAD\" offset=\"0\" target=\"VIEW= \" />" 
    143     "  <magic name=\"RLE\" offset=\"0\" target=\"\\122\\314\" />" 
    144     "  <magic name=\"SCT\" offset=\"0\" target=\"CT\" />" 
    145     "  <magic name=\"SFW\" offset=\"0\" target=\"SFW94\" />" 
    146     "  <magic name=\"SGI\" offset=\"0\" target=\"\\001\\332\" />" 
    147     "  <magic name=\"SUN\" offset=\"0\" target=\"\\131\\246\\152\\225\" />" 
    148     "  <magic name=\"SVG\" offset=\"1\" target=\"?XML\" />" 
    149     "  <magic name=\"SVG\" offset=\"1\" target=\"?xml\" />" 
    150     "  <magic name=\"TXT\" offset=\"0\" target=\"# ImageMagick pixel enumeration:\" />" 
    151     "  <magic name=\"TIFF\" offset=\"0\" target=\"\\115\\115\\000\\052\" />" 
    152     "  <magic name=\"TIFF\" offset=\"0\" target=\"\\111\\111\\052\\000\" />" 
    153     "  <magic name=\"TIFF64\" offset=\"0\" target=\"\\115\\115\\000\\053\\000\\010\\000\\000\" />" 
    154     "  <magic name=\"TIFF64\" offset=\"0\" target=\"\\115\\115\\000\\053\\000\\010\\000\\000\" />" 
    155     "  <magic name=\"VICAR\" offset=\"0\" target=\"LBLSIZE\" />" 
    156     "  <magic name=\"VICAR\" offset=\"0\" target=\"NJPL1I\" />" 
    157     "  <magic name=\"VIFF\" offset=\"0\" target=\"\\253\\001\" />" 
    158     "  <magic name=\"WMF\" offset=\"0\" target=\"\\327\\315\\306\\232\" />" 
    159     "  <magic name=\"WMF\" offset=\"0\" target=\"\\001\\000\\011\\000\" />" 
    160     "  <magic name=\"WPG\" offset=\"0\" target=\"\\377WPC\" />" 
    161     "  <magic name=\"XBM\" offset=\"0\" target=\"#define\" />" 
    162     "  <magic name=\"XCF\" offset=\"0\" target=\"gimp xcf\" />" 
    163     "  <magic name=\"XPM\" offset=\"1\" target=\"* XPM *\" />" 
    164     "  <magic name=\"XWD\" offset=\"4\" target=\"\\007\\000\\000\" />" 
    165     "  <magic name=\"XWD\" offset=\"5\" target=\"\\000\\000\\007\" />" 
    166     "</magicmap>"; 
     64typedef struct _MagicMapInfo 
     65{ 
     66  const char 
     67    *name; 
     68 
     69  unsigned char 
     70    *magic; 
     71 
     72  size_t 
     73    length; 
     74 
     75  ssize_t 
     76    offset; 
     77} MagicMapInfo; 
     78 
     79#define MagicTransform(name,offset,magic) \ 
     80   { name, (unsigned char *) magic,sizeof(magic)-1, offset } 
     81 
     82static const MagicMapInfo 
     83  MagicMap[] = 
     84  { 
     85    MagicTransform("AVI", 0, "RIFF"), 
     86    MagicTransform("8BIMWTEXT", 0, "8\000B\000I\000M\000#"), 
     87    MagicTransform("8BIMTEXT", 0, "8BIM#"), 
     88    MagicTransform("8BIM", 0, "8BIM"), 
     89    MagicTransform("BMP", 0, "BA"), 
     90    MagicTransform("BMP", 0, "BM"), 
     91    MagicTransform("BMP", 0, "CI"), 
     92    MagicTransform("BMP", 0, "CP"), 
     93    MagicTransform("BMP", 0, "IC"), 
     94    MagicTransform("BMP", 0, "PI"), 
     95    MagicTransform("CALS", 21, "version: MIL-STD-1840"), 
     96    MagicTransform("CALS", 0, "srcdocid:"), 
     97    MagicTransform("CALS", 9, "srcdocid:"), 
     98    MagicTransform("CALS", 8, "rorient:"), 
     99    MagicTransform("CGM", 0, "BEGMF"), 
     100    MagicTransform("CIN", 0, "\200\052\137\327"), 
     101    MagicTransform("CRW", 0, "II\x1a\x00\x00\x00HEAPCCDR"), 
     102    MagicTransform("DCM", 128, "DICM"), 
     103    MagicTransform("DCX", 0, "\261\150\336\72"), 
     104    MagicTransform("DIB", 0, "\050\000"), 
     105    MagicTransform("DDS", 0, "DDS "), 
     106    MagicTransform("DJVU", 0, "AT&TFORM"), 
     107    MagicTransform("DOT", 0, "digraph"), 
     108    MagicTransform("DPX", 0, "SDPX"), 
     109    MagicTransform("DPX", 0, "XPDS"), 
     110    MagicTransform("EMF", 40, "\040\105\115\106\000\000\001\000"), 
     111    MagicTransform("EPT", 0, "\305\320\323\306"), 
     112    MagicTransform("EXR", 0, "\166\057\061\001"), 
     113    MagicTransform("FAX", 0, "DFAX"), 
     114    MagicTransform("FIG", 0, "#FIG"), 
     115    MagicTransform("FITS", 0, "IT0"), 
     116    MagicTransform("FITS", 0, "SIMPLE"), 
     117    MagicTransform("FPX", 0, "\320\317\021\340"), 
     118    MagicTransform("GIF", 0, "GIF8"), 
     119    MagicTransform("GPLT", 0, "#!/usr/local/bin/gnuplot"), 
     120    MagicTransform("HDF", 1, "HDF"), 
     121    MagicTransform("HPGL", 0, "IN;"), 
     122    MagicTransform("HPGL", 0, "\033E\033"), 
     123    MagicTransform("HTML", 1, "HTML"), 
     124    MagicTransform("HTML", 1, "html"), 
     125    MagicTransform("ILBM", 8, "ILBM"), 
     126    MagicTransform("IPTCWTEXT", 0, "\062\000#\000\060\000=\000\042\000&\000#\000\060\000;\000&\000#\000\062\000;\000\042\000"), 
     127    MagicTransform("IPTCTEXT", 0, "2#0=\042&#0;&#2;\042"), 
     128    MagicTransform("IPTC", 0, "\034\002"), 
     129    MagicTransform("JNG", 0, "\213JNG\r\n\032\n"), 
     130    MagicTransform("JPEG", 0, "\377\330\377"), 
     131    MagicTransform("JPC", 0, "\377\117"), 
     132    MagicTransform("JP2", 4, "\152\120\040\040\015"), 
     133    MagicTransform("MIFF", 0, "Id=ImageMagick"), 
     134    MagicTransform("MIFF", 0, "id=ImageMagick"), 
     135    MagicTransform("MNG", 0, "\212MNG\r\n\032\n"), 
     136    MagicTransform("MPC", 0, "id=MagickCache"), 
     137    MagicTransform("MPEG", 0, "\000\000\001\263"), 
     138    MagicTransform("MRW", 0, "\x00MRM"), 
     139    MagicTransform("MVG", 0, "push graphic-context"), 
     140    MagicTransform("ORF", 0, "IIRO\x08\x00\x00\x00"), 
     141    MagicTransform("PCD", 2048, "PCD_"), 
     142    MagicTransform("PCL", 0, "\033E\033"), 
     143    MagicTransform("PCX", 0, "\012\002"), 
     144    MagicTransform("PCX", 0, "\012\005"), 
     145    MagicTransform("PDB", 60, "vIMGView"), 
     146    MagicTransform("PDF", 0, "%PDF-"), 
     147    MagicTransform("PFA", 0, "%!PS-AdobeFont-1.0"), 
     148    MagicTransform("PFB", 6, "%!PS-AdobeFont-1.0"), 
     149    MagicTransform("PGX", 0, "\050\107\020\115\046"), 
     150    MagicTransform("PICT", 522, "\000\021\002\377\014\000"), 
     151    MagicTransform("PNG", 0, "\211PNG\r\n\032\n"), 
     152    MagicTransform("PNM", 0, "P1"), 
     153    MagicTransform("PNM", 0, "P2"), 
     154    MagicTransform("PNM", 0, "P3"), 
     155    MagicTransform("PNM", 0, "P4"), 
     156    MagicTransform("PNM", 0, "P5"), 
     157    MagicTransform("PNM", 0, "P6"), 
     158    MagicTransform("PNM", 0, "P7"), 
     159    MagicTransform("PNM", 0, "PF"), 
     160    MagicTransform("PNM", 0, "Pf"), 
     161    MagicTransform("PS", 0, "%!"), 
     162    MagicTransform("PS", 0, "\004%!"), 
     163    MagicTransform("PS", 0, "\305\320\323\306"), 
     164    MagicTransform("PSD", 0, "8BPS"), 
     165    MagicTransform("PWP", 0, "SFW95"), 
     166    MagicTransform("RAF", 0, "FUJIFILMCCD-RAW "), 
     167    MagicTransform("RAD", 0, "#?RADIANCE"), 
     168    MagicTransform("RAD", 0, "VIEW= "), 
     169    MagicTransform("RLE", 0, "\122\314"), 
     170    MagicTransform("SCT", 0, "CT"), 
     171    MagicTransform("SFW", 0, "SFW94"), 
     172    MagicTransform("SGI", 0, "\001\332"), 
     173    MagicTransform("SUN", 0, "\131\246\152\225"), 
     174    MagicTransform("SVG", 1, "?XML"), 
     175    MagicTransform("SVG", 1, "?xml"), 
     176    MagicTransform("TIFF", 0, "\115\115\000\052"), 
     177    MagicTransform("TIFF", 0, "\111\111\052\000"), 
     178    MagicTransform("TIFF64", 0, "\115\115\000\053\000\010\000\000"), 
     179    MagicTransform("TIFF64", 0, "\111\111\053\000\010\000\000\000"), 
     180    MagicTransform("TXT", 0, "# ImageMagick pixel enumeration:"), 
     181    MagicTransform("VICAR", 0, "LBLSIZE"), 
     182    MagicTransform("VICAR", 0, "NJPL1I"), 
     183    MagicTransform("VIFF", 0, "\253\001"), 
     184    MagicTransform("WMF", 0, "\327\315\306\232"), 
     185    MagicTransform("WMF", 0, "\001\000\011\000"), 
     186    MagicTransform("WPG", 0, "\377WPC"), 
     187    MagicTransform("XBM", 0, "#define"), 
     188    MagicTransform("XCF", 0, "gimp xcf"), 
     189    MagicTransform("XEF", 0, "FOVb"), 
     190    MagicTransform("XPM", 1, "* XPM *"), 
     191    MagicTransform("XWD", 4, "\007\000\000"), 
     192    MagicTransform("XWD", 5, "\000\000\007"), 
     193    MagicTransform((const char *) NULL, 0, (const char *) NULL) 
     194 }; 
    167195 
    168196static LinkedListInfo 
     
    207235 
    208236  p=(MagicInfo *) magic_info; 
    209   if (p->path != (char *) NULL) 
    210     p->path=DestroyString(p->path); 
    211   if (p->name != (char *) NULL) 
    212     p->name=DestroyString(p->name); 
    213   if (p->target != (char *) NULL) 
    214     p->target=DestroyString(p->target); 
    215   if (p->magic != (unsigned char *) NULL) 
    216     p->magic=(unsigned char *) RelinquishMagickMemory(p->magic); 
     237  if (p->exempt == MagickFalse) 
     238    { 
     239      if (p->path != (char *) NULL) 
     240        p->path=DestroyString(p->path); 
     241      if (p->name != (char *) NULL) 
     242        p->name=DestroyString(p->name); 
     243      if (p->target != (char *) NULL) 
     244        p->target=DestroyString(p->target); 
     245      if (p->magic != (unsigned char *) NULL) 
     246        p->magic=(unsigned char *) RelinquishMagickMemory(p->magic); 
     247    } 
    217248  p=(MagicInfo *) RelinquishMagickMemory(p); 
    218249  return((void *) NULL); 
     
    367398  assert(number_aliases != (unsigned long *) NULL); 
    368399  *number_aliases=0; 
    369   p=GetMagicInfo((const unsigned char *) "*",0,exception); 
     400  p=GetMagicInfo((const unsigned char *) NULL,0,exception); 
    370401  if (p == (const MagicInfo *) NULL) 
    371402    return((const MagicInfo **) NULL); 
     
    462493  assert(number_aliases != (unsigned long *) NULL); 
    463494  *number_aliases=0; 
    464   p=GetMagicInfo((const unsigned char *) "*",0,exception); 
     495  p=GetMagicInfo((const unsigned char *) NULL,0,exception); 
    465496  if (p == (const MagicInfo *) NULL) 
    466497    return((char **) NULL); 
     
    623654    (void) fprintf(file,"%6ld ",(long) magic_info[i]->offset); 
    624655    if (magic_info[i]->target != (char *) NULL) 
    625       (void) fprintf(file,"%s",magic_info[i]->target); 
     656      { 
     657        register long 
     658          j; 
     659 
     660        for (j=0; magic_info[i]->target[j] != '\0'; j++) 
     661          if (isprint((int) ((unsigned char) magic_info[i]->target[j])) != 0) 
     662            (void) fprintf(file,"%c",magic_info[i]->target[j]); 
     663          else 
     664            (void) fprintf(file,"%#o",magic_info[i]->target[j]); 
     665      } 
    626666    (void) fprintf(file,"\n"); 
    627667  } 
     
    652692%  A description of each parameter follows: 
    653693% 
    654 %    o xml:  The magic list in XML format. 
    655 % 
    656 %    o filename:  The magic list filename. 
     694%    o xml: The magic list in XML format. 
     695% 
     696%    o filename: The magic list filename. 
    657697% 
    658698%    o depth: depth of <include /> statements. 
     
    931971    status; 
    932972 
     973  register const MagicMapInfo 
     974    *p; 
     975 
     976  /* 
     977    Load built-in magic map. 
     978  */ 
    933979  status=MagickFalse; 
     980  if (magic_list == (LinkedListInfo *) NULL) 
     981    magic_list=NewLinkedList(0); 
     982  for (p=MagicMap; p->name != (const char *) NULL; p++) 
     983  { 
     984    MagicInfo 
     985      *magic_info; 
     986 
     987    magic_info=(MagicInfo *) AcquireMagickMemory(sizeof(*magic_info)); 
     988    if (magic_info == (MagicInfo *) NULL) 
     989      ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); 
     990    (void) ResetMagickMemory(magic_info,0,sizeof(*magic_info)); 
     991    magic_info->path="[built-in]"; 
     992    magic_info->name=(char *) p->name; 
     993    magic_info->offset=p->offset; 
     994    magic_info->target=(char *) p->magic; 
     995    magic_info->magic=p->magic; 
     996    magic_info->length=p->length; 
     997    magic_info->exempt=MagickTrue; 
     998    magic_info->signature=MagickSignature; 
     999    status=AppendValueToLinkedList(magic_list,magic_info); 
     1000    if (status == MagickFalse) 
     1001      (void) ThrowMagickException(exception,GetMagickModule(), 
     1002        ResourceLimitError,"MemoryAllocationFailed","`%s'",magic_info->name); 
     1003  } 
     1004  /* 
     1005    Load external magic map. 
     1006  */ 
    9341007  *path='\0'; 
    9351008  options=GetConfigureOptions(filename,exception); 
     
    9431016  } 
    9441017  options=DestroyConfigureOptions(options); 
    945   if ((magic_list == (LinkedListInfo *) NULL) || 
    946       (IsLinkedListEmpty(magic_list) != MagickFalse)) 
    947     { 
    948       (void) ThrowMagickException(exception,GetMagickModule(),ConfigureWarning, 
    949         "UnableToOpenConfigureFile","`%s'",path); 
    950       status|=LoadMagicList(MagicMap,"built-in",0,exception); 
    951     } 
    9521018  return(status != 0 ? MagickTrue : MagickFalse); 
    9531019#endif 
  • ImageMagick/trunk/magick/magic.h

    r1 r380  
    4040 
    4141  MagickBooleanType 
     42    exempt, 
    4243    stealth; 
    4344 
  • VisualMagick/trunk/bin/magic.xml

    r1 r380  
    77<!ATTLIST magic target CDATA #REQUIRED> 
    88]> 
     9<!-- 
     10  Associate an image format with a unique identifier.  
     11 
     12  Many image formats have identifiers that uniquely identify a particular 
     13  image format. For example, the GIF image format always begins with GIF8 
     14  as the first 4 characters of the image. ImageMagick uses this information 
     15  to quickly determine the type of image it is dealing with when it reads 
     16  an image. 
     17--> 
    918<magicmap> 
    10   <magic name="AVI" offset="0" target="RIFF"/> 
    11   <magic name="8BIMWTEXT" offset="0" target="8\000B\000I\000M\000#"/> 
    12   <magic name="8BIMTEXT" offset="0" target="8BIM#"/> 
    13   <magic name="8BIM" offset="0" target="8BIM"/> 
    14   <magic name="BMP" offset="0" target="BA"/> 
    15   <magic name="BMP" offset="0" target="BM"/> 
    16   <magic name="BMP" offset="0" target="CI"/> 
    17   <magic name="BMP" offset="0" target="CP"/> 
    18   <magic name="BMP" offset="0" target="IC"/> 
    19   <magic name="BMP" offset="0" target="PI"/> 
    20   <magic name="CGM" offset="0" target="BEGMF"/> 
    21   <magic name="CIN" offset="0" target="\200\052\137\327"/> 
    22   <magic name="CRW" offset="0" target="II\x1a\x00\x00\x00HEAPCCDR"/> 
    23   <magic name="DCM" offset="128" target="DICM"/> 
    24   <magic name="DCX" offset="0" target="\261\150\336\72"/> 
    25   <magic name="DDS" offset="0" target="DDS "/> 
    26   <magic name="DIB" offset="0" target="\050\000"/> 
    27   <magic name="DJVU" offset="0" target="AT&amp;TFORM"/> 
    28   <magic name="DOT" offset="0" target="digraph"/> 
    29   <magic name="DPX" offset="0" target="SDPX"/> 
    30   <magic name="DPX" offset="0" target="XPDS"/> 
    31   <magic name="EMF" offset="40" target="\040\105\115\106\000\000\001\000"/> 
    32   <magic name="EPT" offset="0" target="\305\320\323\306"/> 
    33   <magic name="EXR" offset="0" target="\166\057\061\001"/> 
    34   <magic name="FAX" offset="0" target="DFAX"/> 
    35   <magic name="FIG" offset="0" target="#FIG"/> 
    36   <magic name="FITS" offset="0" target="IT0"/> 
    37   <magic name="FITS" offset="0" target="SIMPLE"/> 
    38   <magic name="FPX" offset="0" target="\320\317\021\340"/> 
    39   <magic name="GIF" offset="0" target="GIF8"/> 
    40   <magic name="GPLT" offset="0" target="#!/usr/local/bin/gnuplot"/> 
    41   <magic name="HDF" offset="1" target="HDF"/> 
    42   <magic name="HPGL" offset="0" target="IN;"/> 
    43   <magic name="HTML" offset="1" target="HTML"/> 
    44   <magic name="HTML" offset="1" target="html"/> 
    45   <magic name="ILBM" offset="8" target="ILBM"/> 
    46   <magic name="IPTCWTEXT" offset="0" target="\062\000#\000\060\000=\000\042\000&amp;\000#\000\060\000;\000&amp;\000#\000\062\000;\000\042\000"/> 
    47   <magic name="IPTCTEXT" offset="0" target="2#0=\042&amp;#0;&amp;#2;\042"/> 
    48   <magic name="IPTC" offset="0" target="\034\002"/> 
    49   <magic name="JNG" offset="0" target="\213JNG\r\n\032\n"/> 
    50   <magic name="JPEG" offset="0" target="\377\330\377"/> 
    51   <magic name="JPC" offset="0" target="\377\117"/> 
    52   <magic name="JP2" offset="4" target="\152\120\040\040\015"/> 
    53   <magic name="MIFF" offset="0" target="Id=ImageMagick"/> 
    54   <magic name="MIFF" offset="0" target="id=ImageMagick"/> 
    55   <magic name="MNG" offset="0" target="\212MNG\r\n\032\n"/> 
    56   <magic name="MPC" offset="0" target="id=MagickCache"/> 
    57   <magic name="MPEG" offset="0" target="\000\000\001\263"/> 
    58   <magic name="MRW" offset="0" target="\x00MRM"/> 
    59   <magic name="MVG" offset="0" target="push graphic-context"/> 
    60   <magic name="ORF" offset="0" target="IIRO\x08\x00\x00\x00"/> 
    61   <magic name="PCD" offset="2048" target="PCD_"/> 
    62   <magic name="PCL" offset="0" target="\033E\033"/> 
    63   <magic name="PCX" offset="0" target="\012\002"/> 
    64   <magic name="PCX" offset="0" target="\012\005"/> 
    65   <magic name="PDB" offset="60" target="vIMGView"/> 
    66   <magic name="PDF" offset="0" target="%PDF-"/> 
    67   <magic name="PFA" offset="0" target="%!PS-AdobeFont-1.0"/> 
    68   <magic name="PFB" offset="6" target="%!PS-AdobeFont-1.0"/> 
    69   <magic name="PGX" offset="0" target="\050\107\020\115\046"/> 
    70   <magic name="PICT" offset="522" target="\000\021\002\377\014\000"/> 
    71   <magic name="PNG" offset="0" target="\211PNG\r\n\032\n"/> 
    72   <magic name="PNM" offset="0" target="P1"/> 
    73   <magic name="PNM" offset="0" target="P2"/> 
    74   <magic name="PNM" offset="0" target="P3"/> 
    75   <magic name="PNM" offset="0" target="P4"/> 
    76   <magic name="PNM" offset="0" target="P5"/> 
    77   <magic name="PNM" offset="0" target="P6"/> 
    78   <magic name="PNM" offset="0" target="P7"/> 
    79   <magic name="PNM" offset="0" target="PF"/> 
    80   <magic name="PNM" offset="0" target="Pf"/> 
    81   <magic name="PS" offset="0" target="%!"/> 
    82   <magic name="PS" offset="0" target="\004%!"/> 
    83   <magic name="PS" offset="0" target="\305\320\323\306"/> 
    84   <magic name="PSD" offset="0" target="8BPS"/> 
    85   <magic name="PWP" offset="0" target="SFW95"/> 
    86   <magic name="RAD" offset="0" target="#?RADIANCE"/> 
    87   <magic name="RAD" offset="0" target="VIEW= "/> 
    88   <magic name="RAF" offset="0" target="FUJIFILMCCD-RAW "/> 
    89   <magic name="RLE" offset="0" target="\122\314"/> 
    90   <magic name="SCT" offset="0" target="CT"/> 
    91   <magic name="SFW" offset="0" target="SFW94"/> 
    92   <magic name="SGI" offset="0" target="\001\332"/> 
    93   <magic name="SUN" offset="0" target="\131\246\152\225"/> 
    94   <magic name="SVG" offset="1" target="?XML"/> 
    95   <magic name="SVG" offset="1" target="?xml"/> 
    96   <magic name="TXT" offset="0" target="# ImageMagick pixel enumeration:"/> 
    97   <magic name="TIFF" offset="0" target="\115\115\000\052"/> 
    98   <magic name="TIFF" offset="0" target="\111\111\052\000"/> 
    99   <magic name="TIFF64" offset="0" target="\115\115\000\053\000\010\000\000"/> 
    100   <magic name="TIFF64" offset="0" target="\111\111\053\000\010\000\000\000"/> 
    101   <magic name="VICAR" offset="0" target="LBLSIZE"/> 
    102   <magic name="VICAR" offset="0" target="NJPL1I"/> 
    103   <magic name="VIFF" offset="0" target="\253\001"/> 
    104   <magic name="WMF" offset="0" target="\327\315\306\232"/> 
    105   <magic name="WMF" offset="0" target="\001\000\011\000"/> 
    106   <magic name="WPG" offset="0" target="\377WPC"/> 
    107   <magic name="XBM" offset="0" target="#define"/> 
    108   <magic name="XCF" offset="0" target="gimp xcf"/> 
    109   <magic name="XPM" offset="1" target="* XPM *"/> 
    110   <magic name="XWD" offset="4" target="\007\000\000"/> 
    111   <magic name="XWD" offset="5" target="\000\000\007"/> 
    112   <magic name="XEF" offset="0" target="FOVb"/> 
     19  <!-- <magic name="GIF" offset="0" target="GIF8"/> --> 
     20  <!-- <magic name="JPEG" offset="0" target="\377\330\377"/> --> 
     21  <!-- <magic name="PNG" offset="0" target="\211PNG\r\n\032\n"/> --> 
     22  <!-- <magic name="TIFF" offset="0" target="\115\115\000\052"/> --> 
    11323</magicmap> 
  • VisualMagick/trunk/bin/policy.xml

    r1 r380  
    1010]> 
    1111<!-- 
    12   ImageMagick policies. 
     12  Configure ImageMagick policies. 
    1313 
    14   Domains include delegate, coder, filter, path or resources. 
     14  Domains include delegate, coder, filter, path, or resource. 
    1515 
    1616  Rights include none, read, write, and execute.  Use | to combine them, 
    17   for example: "read | write" to permit read or write from / to a path. 
     17  for example: "read | write" to permit read from, or write to, a path. 
    1818 
    1919  Use a glob expression as a pattern. 
     
    4848  <!-- <policy domain="resource" name="file" value="768"/> --> 
    4949  <!-- <policy domain="resource" name="thread" value="8"/> --> 
     50  <!-- <policy domain="resource" name="time" value="3600"/> --> 
    5051</policymap>