1 2 3 4 5 <!DOCTYPE html> 6 <html lang="en"> 7 <head> 8 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 9 <title>ImageMagick: MagickCore, C API for ImageMagick: Read or Write Binary Large OBjects</title> 10 <meta http-equiv="content-type" content="text/html; charset=utf-8"/> 11 <meta name="application-name" content="ImageMagick"/> 12 <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."/> 13 <meta name="application-url" content="http://www.imagemagick.org"/> 14 <meta name="generator" content="PHP"/> 15 <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"/> 16 <meta name="rating" content="GENERAL"/> 17 <meta name="robots" content="INDEX, FOLLOW"/> 18 <meta name="generator" content="ImageMagick Studio LLC"/> 19 <meta name="author" content="ImageMagick Studio LLC"/> 20 <meta name="revisit-after" content="2 DAYS"/> 21 <meta name="resource-type" content="document"/> 22 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC"/> 23 <meta name="distribution" content="Global"/> 24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/> 25 <link rel="icon" href="../image/wand.png"/> 26 <link rel="shortcut icon" href="../image/wand.ico"/> 27 <link rel="stylesheet" href="../css/magick.php"/> 28 </head> 29 <body> 30 <div class="main"> 31 <div class="magick-masthead"> 32 <div class="container"> 33 <script async="async" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" 34 style="display:block" 35 data-ad-client="ca-pub-3129977114552745" 36 data-ad-slot="6345125851" 37 data-ad-format="auto"></ins> 38 <script> 39 (adsbygoogle = window.adsbygoogle || []).push({}); 40 </script> 41 <nav class="magick-nav"> 42 <a class="magick-nav-item " href="../index.php">Home</a> 43 <a class="magick-nav-item " href="../script/binary-releases.php">Download</a> 44 <a class="magick-nav-item " href="../script/command-line-tools.php">Tools</a> 45 <a class="magick-nav-item " href="../script/command-line-processing.php">Command-line</a> 46 <a class="magick-nav-item " href="../script/resources.php">Resources</a> 47 <a class="magick-nav-item " href="../script/api.php">Develop</a> 48 <a class="magick-nav-item " href="../script/search.php">Search</a> 49 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a> 50 </nav> 51 </div> 52 </div> 53 <div class="container"> 54 <div class="magick-header"> 55 <p class="text-center"><a href="blob.php#BlobToImage">BlobToImage</a> • <a href="blob.php#FileToImage">FileToImage</a> • <a href="blob.php#GetBlobProperties">GetBlobProperties</a> • <a href="blob.php#ImageToBlob">ImageToBlob</a> • <a href="blob.php#ImageToFile">ImageToFile</a> • <a href="blob.php#ImagesToBlob">ImagesToBlob</a> • <a href="blob.php#InjectImageBlob">InjectImageBlob</a></p> 56 57 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="BlobToImage">BlobToImage</a></h2> 58 59 <p>BlobToImage() implements direct to memory image formats. It returns the blob as an image.</p> 60 61 <p>The format of the BlobToImage method is:</p> 62 63 <pre class="text"> 64 Image *BlobToImage(const ImageInfo *image_info,const void *blob, 65 const size_t length,ExceptionInfo *exception) 66 </pre> 67 68 <p>A description of each parameter follows:</p> 69 70 <dd> 71 </dd> 72 73 <dd> </dd> 74 <dl class="dl-horizontal"> 75 <dt>image_info</dt> 76 <dd>the image info. </dd> 77 78 <dd> </dd> 79 <dt>blob</dt> 80 <dd>the address of a character stream in one of the image formats understood by ImageMagick. </dd> 81 82 <dd> </dd> 83 <dt>length</dt> 84 <dd>This size_t integer reflects the length in bytes of the blob. </dd> 85 86 <dd> </dd> 87 <dt>exception</dt> 88 <dd>return any errors or warnings in this structure. </dd> 89 90 <dd> </dd> 91 </dl> 92 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="FileToImage">FileToImage</a></h2> 93 94 <p>FileToImage() write the contents of a file to an image.</p> 95 96 <p>The format of the FileToImage method is:</p> 97 98 <pre class="text"> 99 MagickBooleanType FileToImage(Image *,const char *filename) 100 </pre> 101 102 <p>A description of each parameter follows:</p> 103 104 <dd> 105 </dd> 106 107 <dd> </dd> 108 <dl class="dl-horizontal"> 109 <dt>image</dt> 110 <dd>the image. </dd> 111 112 <dd> </dd> 113 <dt>filename</dt> 114 <dd>the filename. </dd> 115 116 <dd> </dd> 117 </dl> 118 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="GetBlobProperties">GetBlobProperties</a></h2> 119 120 <p>GetBlobProperties() returns information about an image blob.</p> 121 122 <p>The format of the GetBlobProperties method is:</p> 123 124 <pre class="text"> 125 const struct stat *GetBlobProperties(const Image *image) 126 </pre> 127 128 <p>A description of each parameter follows:</p> 129 130 <dd> 131 </dd> 132 133 <dd> </dd> 134 <dl class="dl-horizontal"> 135 <dt>image</dt> 136 <dd>the image. </dd> 137 138 <dd> </dd> 139 </dl> 140 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="ImageToBlob">ImageToBlob</a></h2> 141 142 <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> 143 144 <p>The format of the ImageToBlob method is:</p> 145 146 <pre class="text"> 147 void *ImageToBlob(const ImageInfo *image_info,Image *image, 148 size_t *length,ExceptionInfo *exception) 149 </pre> 150 151 <p>A description of each parameter follows:</p> 152 153 <dd> 154 </dd> 155 156 <dd> </dd> 157 <dl class="dl-horizontal"> 158 <dt>image_info</dt> 159 <dd>the image info. </dd> 160 161 <dd> </dd> 162 <dt>image</dt> 163 <dd>the image. </dd> 164 165 <dd> </dd> 166 <dt>length</dt> 167 <dd>return the actual length of the blob. </dd> 168 169 <dd> </dd> 170 <dt>exception</dt> 171 <dd>return any errors or warnings in this structure. </dd> 172 173 <dd> </dd> 174 </dl> 175 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="ImageToFile">ImageToFile</a></h2> 176 177 <p>ImageToFile() writes an image to a file. It returns MagickFalse if an error occurs otherwise MagickTrue.</p> 178 179 <p>The format of the ImageToFile method is:</p> 180 181 <pre class="text"> 182 MagickBooleanType ImageToFile(Image *image,char *filename, 183 ExceptionInfo *exception) 184 </pre> 185 186 <p>A description of each parameter follows:</p> 187 188 <dd> 189 </dd> 190 191 <dd> </dd> 192 <dl class="dl-horizontal"> 193 <dt>image</dt> 194 <dd>the image. </dd> 195 196 <dd> </dd> 197 <dt>filename</dt> 198 <dd>Write the image to this file. </dd> 199 200 <dd> </dd> 201 <dt>exception</dt> 202 <dd>return any errors or warnings in this structure. </dd> 203 204 <dd> </dd> 205 </dl> 206 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="ImagesToBlob">ImagesToBlob</a></h2> 207 208 <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> 209 210 <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> 211 212 <p>The format of the ImagesToBlob method is:</p> 213 214 <pre class="text"> 215 void *ImagesToBlob(const ImageInfo *image_info,Image *images, 216 size_t *length,ExceptionInfo *exception) 217 </pre> 218 219 <p>A description of each parameter follows:</p> 220 221 <dd> 222 </dd> 223 224 <dd> </dd> 225 <dl class="dl-horizontal"> 226 <dt>image_info</dt> 227 <dd>the image info. </dd> 228 229 <dd> </dd> 230 <dt>images</dt> 231 <dd>the image list. </dd> 232 233 <dd> </dd> 234 <dt>length</dt> 235 <dd>return the actual length of the blob. </dd> 236 237 <dd> </dd> 238 <dt>exception</dt> 239 <dd>return any errors or warnings in this structure. </dd> 240 241 <dd> </dd> 242 </dl> 243 <h2><a href="http://www.imagemagick.org/api/MagickCore/blob_8c.html" id="InjectImageBlob">InjectImageBlob</a></h2> 244 245 <p>InjectImageBlob() injects the image with a copy of itself in the specified format (e.g. inject JPEG into a PDF image).</p> 246 247 <p>The format of the InjectImageBlob method is:</p> 248 249 <pre class="text"> 250 MagickBooleanType InjectImageBlob(const ImageInfo *image_info, 251 Image *image,Image *inject_image,const char *format, 252 ExceptionInfo *exception) 253 </pre> 254 255 <p>A description of each parameter follows:</p> 256 257 <dd> 258 </dd> 259 260 <dd> </dd> 261 <dl class="dl-horizontal"> 262 <dt>image_info</dt> 263 <dd>the image info.. </dd> 264 265 <dd> </dd> 266 <dt>image</dt> 267 <dd>the image. </dd> 268 269 <dd> </dd> 270 <dt>inject_image</dt> 271 <dd>inject into the image stream. </dd> 272 273 <dd> </dd> 274 <dt>format</dt> 275 <dd>the image format. </dd> 276 277 <dd> </dd> 278 <dt>exception</dt> 279 <dd>return any errors or warnings in this structure. </dd> 280 281 <dd> </dd> 282 </dl> 283 </div> 284 <footer class="magick-footer"> 285 <p><a href="../script/support.php">Donate</a> 286 <a href="../script/sitemap.php">Sitemap</a> 287 <a href="../script/links.php">Related</a> 288 <a href="../script/architecture.php">Architecture</a> 289 </p> 290 <p><a href="blob.php#">Back to top</a> 291 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> 292 <a href="../script/contact.php">Contact Us</a></p> 293 <p><small> 1999-2016 ImageMagick Studio LLC</small></p> 294 </footer> 295 </div><!-- /.container --> 296 297 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 298 <script src="http://nextgen.imagemagick.org/js/magick.php"></script> 299 </div> 300 </body> 301 </html> 302