Home | History | Annotate | Download | only in api
      1 
      2 
      3 
      4 
      5 <!DOCTYPE html>
      6 <html lang="en">
      7 <head>
      8     <title>ImageMagick: MagickCore, C API for ImageMagick: Read or Write Binary Large OBjects</title>
      9   <meta charset="utf-8" />
     10   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     11   <meta name="viewport" content="width=device-width, initial-scale=1" />
     12   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
     13   <meta name="application-name" content="ImageMagick"/>
     14   <meta name="description" content="ImageMagick is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bzier curves."/>
     15   <meta name="application-url" content="http://www.imagemagick.org"/>
     16   <meta name="generator" content="PHP"/>
     17   <meta name="keywords" content="magickcore, c, api, for, imagemagick:, read, or, write, binary, large, objects, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
     18   <meta name="rating" content="GENERAL"/>
     19   <meta name="robots" content="INDEX, FOLLOW"/>
     20   <meta name="generator" content="ImageMagick Studio LLC"/>
     21   <meta name="author" content="ImageMagick Studio LLC"/>
     22   <meta name="revisit-after" content="2 DAYS"/>
     23   <meta name="resource-type" content="document"/>
     24   <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/>
     25   <meta name="distribution" content="Global"/>
     26   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
     27   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
     28   <link rel="icon" href="../images/wand.png"/>
     29   <link rel="shortcut icon" href="../images/wand.ico"/>
     30   <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700">
     31   <link rel="stylesheet" href="../css/magick.html"/>
     32 </head>
     33 <body>
     34 <div class="main">
     35 <div class="magick-masthead">
     36   <div class="container">
     37     <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
     38          style="display:block"
     39          data-ad-client="ca-pub-3129977114552745"
     40          data-ad-slot="6345125851"
     41          data-ad-format="auto"></ins>
     42     <script>
     43       (adsbygoogle = window.adsbygoogle || []).push({});
     44     </script>
     45     <nav class="magick-nav">
     46       <a class="magick-nav-item " href="../index.html">Home</a>
     47       <a class="magick-nav-item " href="../binary-releases.html">Download</a>
     48       <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
     49       <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a>
     50       <a class="magick-nav-item " href="../resources.html">Resources</a>
     51       <a class="magick-nav-item " href="api.html">Develop</a>
     52       <a class="magick-nav-item " href="http://www.imagemagick.org/script/search.php">Search</a>
     53       <a class="magick-nav-item pull-right" href="https://www.imagemagick.org/discourse-server/">Community</a>
     54     </nav>
     55   </div>
     56 </div>
     57 <div class="container">
     58 <div class="magick-header">
     59 <p class="text-center"><a href="blob.html#BlobToImage">BlobToImage</a> &#8226; <a href="blob.html#FileToBlob">FileToBlob</a> &#8226; <a href="blob.html#FileToImage">FileToImage</a> &#8226; <a href="blob.html#GetBlobProperties">GetBlobProperties</a> &#8226; <a href="blob.html#ImageToBlob">ImageToBlob</a> &#8226; <a href="blob.html#ImageToFile">ImageToFile</a> &#8226; <a href="blob.html#ImagesToBlob">ImagesToBlob</a> &#8226; <a href="blob.html#InjectImageBlob">InjectImageBlob</a> &#8226; <a href="blob.html#IsBlobExempt">IsBlobExempt</a> &#8226; <a href="blob.html#IsBlobSeekable">IsBlobSeekable</a> &#8226; <a href="blob.html#IsBlobTemporary">IsBlobTemporary</a></p>
     60 
     61 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="BlobToImage">BlobToImage</a></h2>
     62 
     63 <p>BlobToImage() implements direct to memory image formats.  It returns the blob as an image.</p>
     64 
     65 <p>The format of the BlobToImage method is:</p>
     66 
     67 <pre class="text">
     68 Image *BlobToImage(const ImageInfo *image_info,const void *blob,
     69   const size_t length,ExceptionInfo *exception)
     70 </pre>
     71 
     72 <p>A description of each parameter follows:</p>
     73 
     74 <dd>
     75 </dd>
     76 
     77 <dd> </dd>
     78 <dl class="dl-horizontal">
     79 <dt>image_info</dt>
     80 <dd>the image info. </dd>
     81 
     82 <dd> </dd>
     83 <dt>blob</dt>
     84 <dd>the address of a character stream in one of the image formats understood by ImageMagick. </dd>
     85 
     86 <dd> </dd>
     87 <dt>length</dt>
     88 <dd>This size_t integer reflects the length in bytes of the blob. </dd>
     89 
     90 <dd> </dd>
     91 <dt>exception</dt>
     92 <dd>return any errors or warnings in this structure. </dd>
     93 
     94 <dd>  </dd>
     95 </dl>
     96 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="FileToBlob">FileToBlob</a></h2>
     97 
     98 <p>FileToBlob() returns the contents of a file as a buffer terminated with the '\0' character.  The length of the buffer (not including the extra terminating '\0' character) is returned via the 'length' parameter.  Free the buffer with RelinquishMagickMemory().</p>
     99 
    100 <p>The format of the FileToBlob method is:</p>
    101 
    102 <pre class="text">
    103 void *FileToBlob(const char *filename,const size_t extent,
    104   size_t *length,ExceptionInfo *exception)
    105 </pre>
    106 
    107 <p>A description of each parameter follows:</p>
    108 
    109 <dd>
    110 </dd>
    111 
    112 <dd> </dd>
    113 <dl class="dl-horizontal">
    114 <dt>blob</dt>
    115 <dd> FileToBlob() returns the contents of a file as a blob.  If an error occurs NULL is returned. </dd>
    116 
    117 <dd> </dd>
    118 <dt>filename</dt>
    119 <dd>the filename. </dd>
    120 
    121 <dd> </dd>
    122 <dt>extent</dt>
    123 <dd> The maximum length of the blob. </dd>
    124 
    125 <dd> </dd>
    126 <dt>length</dt>
    127 <dd>On return, this reflects the actual length of the blob. </dd>
    128 
    129 <dd> </dd>
    130 <dt>exception</dt>
    131 <dd>return any errors or warnings in this structure. </dd>
    132 
    133 <dd>  </dd>
    134 </dl>
    135 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="FileToImage">FileToImage</a></h2>
    136 
    137 <p>FileToImage() write the contents of a file to an image.</p>
    138 
    139 <p>The format of the FileToImage method is:</p>
    140 
    141 <pre class="text">
    142 MagickBooleanType FileToImage(Image *,const char *filename)
    143 </pre>
    144 
    145 <p>A description of each parameter follows:</p>
    146 
    147 <dd>
    148 </dd>
    149 
    150 <dd> </dd>
    151 <dl class="dl-horizontal">
    152 <dt>image</dt>
    153 <dd>the image. </dd>
    154 
    155 <dd> </dd>
    156 <dt>filename</dt>
    157 <dd>the filename. </dd>
    158 
    159 <dd>  </dd>
    160 </dl>
    161 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="GetBlobProperties">GetBlobProperties</a></h2>
    162 
    163 <p>GetBlobProperties() returns information about an image blob.</p>
    164 
    165 <p>The format of the GetBlobProperties method is:</p>
    166 
    167 <pre class="text">
    168 const struct stat *GetBlobProperties(const Image *image)
    169 </pre>
    170 
    171 <p>A description of each parameter follows:</p>
    172 
    173 <dd>
    174 </dd>
    175 
    176 <dd> </dd>
    177 <dl class="dl-horizontal">
    178 <dt>image</dt>
    179 <dd>the image. </dd>
    180 
    181 <dd>  </dd>
    182 </dl>
    183 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="ImageToBlob">ImageToBlob</a></h2>
    184 
    185 <p>ImageToBlob() implements direct to memory image formats.  It returns the image as a formatted blob and its length.  The magick member of the Image structure determines the format of the returned blob (GIF, JPEG, PNG, etc.).  This method is the equivalent of WriteImage(), but writes the formatted "file" to a memory buffer rather than to an actual file.</p>
    186 
    187 <p>The format of the ImageToBlob method is:</p>
    188 
    189 <pre class="text">
    190 void *ImageToBlob(const ImageInfo *image_info,Image *image,
    191   size_t *length,ExceptionInfo *exception)
    192 </pre>
    193 
    194 <p>A description of each parameter follows:</p>
    195 
    196 <dd>
    197 </dd>
    198 
    199 <dd> </dd>
    200 <dl class="dl-horizontal">
    201 <dt>image_info</dt>
    202 <dd>the image info. </dd>
    203 
    204 <dd> </dd>
    205 <dt>image</dt>
    206 <dd>the image. </dd>
    207 
    208 <dd> </dd>
    209 <dt>length</dt>
    210 <dd>return the actual length of the blob. </dd>
    211 
    212 <dd> </dd>
    213 <dt>exception</dt>
    214 <dd>return any errors or warnings in this structure. </dd>
    215 
    216 <dd>  </dd>
    217 </dl>
    218 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="ImageToFile">ImageToFile</a></h2>
    219 
    220 <p>ImageToFile() writes an image to a file.  It returns MagickFalse if an error occurs otherwise MagickTrue.</p>
    221 
    222 <p>The format of the ImageToFile method is:</p>
    223 
    224 <pre class="text">
    225  MagickBooleanType ImageToFile(Image *image,char *filename,
    226    ExceptionInfo *exception)
    227 </pre>
    228 
    229 <p>A description of each parameter follows:</p>
    230 
    231 <dd>
    232 </dd>
    233 
    234 <dd> </dd>
    235 <dl class="dl-horizontal">
    236 <dt>image</dt>
    237 <dd>the image. </dd>
    238 
    239 <dd> </dd>
    240 <dt>filename</dt>
    241 <dd>Write the image to this file. </dd>
    242 
    243 <dd> </dd>
    244 <dt>exception</dt>
    245 <dd>return any errors or warnings in this structure. </dd>
    246 
    247 <dd>  </dd>
    248 </dl>
    249 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="ImagesToBlob">ImagesToBlob</a></h2>
    250 
    251 <p>ImagesToBlob() implements direct to memory image formats.  It returns the image sequence as a blob and its length.  The magick member of the ImageInfo structure determines the format of the returned blob (GIF, JPEG,  PNG, etc.)</p>
    252 
    253 <p>Note, some image formats do not permit multiple images to the same image stream (e.g. JPEG).  in this instance, just the first image of the sequence is returned as a blob.</p>
    254 
    255 <p>The format of the ImagesToBlob method is:</p>
    256 
    257 <pre class="text">
    258 void *ImagesToBlob(const ImageInfo *image_info,Image *images,
    259   size_t *length,ExceptionInfo *exception)
    260 </pre>
    261 
    262 <p>A description of each parameter follows:</p>
    263 
    264 <dd>
    265 </dd>
    266 
    267 <dd> </dd>
    268 <dl class="dl-horizontal">
    269 <dt>image_info</dt>
    270 <dd>the image info. </dd>
    271 
    272 <dd> </dd>
    273 <dt>images</dt>
    274 <dd>the image list. </dd>
    275 
    276 <dd> </dd>
    277 <dt>length</dt>
    278 <dd>return the actual length of the blob. </dd>
    279 
    280 <dd> </dd>
    281 <dt>exception</dt>
    282 <dd>return any errors or warnings in this structure. </dd>
    283 
    284 <dd>  </dd>
    285 </dl>
    286 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="InjectImageBlob">InjectImageBlob</a></h2>
    287 
    288 <p>InjectImageBlob() injects the image with a copy of itself in the specified format (e.g. inject JPEG into a PDF image).</p>
    289 
    290 <p>The format of the InjectImageBlob method is:</p>
    291 
    292 <pre class="text">
    293 MagickBooleanType InjectImageBlob(const ImageInfo *image_info,
    294   Image *image,Image *inject_image,const char *format,
    295   ExceptionInfo *exception)
    296 </pre>
    297 
    298 <p>A description of each parameter follows:</p>
    299 
    300 <dd>
    301 </dd>
    302 
    303 <dd> </dd>
    304 <dl class="dl-horizontal">
    305 <dt>image_info</dt>
    306 <dd>the image info.. </dd>
    307 
    308 <dd> </dd>
    309 <dt>image</dt>
    310 <dd>the image. </dd>
    311 
    312 <dd> </dd>
    313 <dt>inject_image</dt>
    314 <dd>inject into the image stream. </dd>
    315 
    316 <dd> </dd>
    317 <dt>format</dt>
    318 <dd>the image format. </dd>
    319 
    320 <dd> </dd>
    321 <dt>exception</dt>
    322 <dd>return any errors or warnings in this structure. </dd>
    323 
    324 <dd>  </dd>
    325 </dl>
    326 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="IsBlobExempt">IsBlobExempt</a></h2>
    327 
    328 <p>IsBlobExempt() returns true if the blob is exempt.</p>
    329 
    330 <p>The format of the IsBlobExempt method is:</p>
    331 
    332 <pre class="text">
    333  MagickBooleanType IsBlobExempt(const Image *image)
    334 </pre>
    335 
    336 <p>A description of each parameter follows:</p>
    337 
    338 <dd>
    339 </dd>
    340 
    341 <dd> </dd>
    342 <dl class="dl-horizontal">
    343 <dt>image</dt>
    344 <dd>the image. </dd>
    345 
    346 <dd>  </dd>
    347 </dl>
    348 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="IsBlobSeekable">IsBlobSeekable</a></h2>
    349 
    350 <p>IsBlobSeekable() returns true if the blob is seekable.</p>
    351 
    352 <p>The format of the IsBlobSeekable method is:</p>
    353 
    354 <pre class="text">
    355  MagickBooleanType IsBlobSeekable(const Image *image)
    356 </pre>
    357 
    358 <p>A description of each parameter follows:</p>
    359 
    360 <dd>
    361 </dd>
    362 
    363 <dd> </dd>
    364 <dl class="dl-horizontal">
    365 <dt>image</dt>
    366 <dd>the image. </dd>
    367 
    368 <dd>  </dd>
    369 </dl>
    370 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="IsBlobTemporary">IsBlobTemporary</a></h2>
    371 
    372 <p>IsBlobTemporary() returns true if the blob is temporary.</p>
    373 
    374 <p>The format of the IsBlobTemporary method is:</p>
    375 
    376 <pre class="text">
    377  MagickBooleanType IsBlobTemporary(const Image *image)
    378 </pre>
    379 
    380 <p>A description of each parameter follows:</p>
    381 
    382 <dd>
    383 </dd>
    384 
    385 <dd> </dd>
    386 <dl class="dl-horizontal">
    387 <dt>image</dt>
    388 <dd>the image. </dd>
    389 
    390 <dd>  </dd>
    391 </dl>
    392 </div>
    393   <footer class="magick-footer">
    394     <p><a href="../support.html">Donate</a> 
    395      <a href="../sitemap.html">Sitemap</a> 
    396     <a href="../links.html">Related</a> 
    397     <a href="../architecture.html">Architecture</a>
    398 </p>
    399     <p><a href="blob.html#">Back to top</a> 
    400     <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> 
    401     <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
    402         <p><small>  1999-2016 ImageMagick Studio LLC</small></p>
    403   </footer>
    404 </div><!-- /.container -->
    405 
    406   <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    407   <script src="../js/magick.html"></script>
    408 </div>
    409 </body>
    410 </html>
    411