• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8  <meta charset="utf-8"  />
9  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
10  <title>ImageMagick - MagickCore, C API: Read or Write Binary Large OBjects</title>
11  <meta name="application-name" content="ImageMagick" />
12  <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert bitmap images. Resize an image, crop it, change its shades and colors, add captions, and more." />
13  <meta name="application-url" content="https://imagemagick.org" />
14  <meta name="generator" content="PHP" />
15  <meta name="keywords" content="magickcore, c, api:, 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-2020 ImageMagick Studio LLC" />
23  <meta name="distribution" content="Global" />
24  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25  <meta property='og:url' content='../../' />
26  <meta property='og:title' content='ImageMagick' />
27  <meta property='og:image' content='../../images/logo.png' />
28  <meta property='og:type' content='website' />
29  <meta property='og:site_name' content='ImageMagick' />
30  <meta property='og:description' content="Convert, Edit, or Compose Bitmap Images" />
31  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
32  <link href="blob.html" rel="canonical" />
33  <link href="../../images/wand.png" rel="icon" />
34  <link href="../../images/wand.ico" rel="shortcut icon" />
35  <link href="../assets/magick.css" rel="stylesheet" />
36</head>
37<body>
38  <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
39    <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../images/wand.ico"/></a>
40    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
41      <span class="navbar-toggler-icon"></span>
42    </button>
43
44    <div class="navbar-collapse collapse" id="navbarsMagick" style="">
45    <ul class="navbar-nav mr-auto">
46      <li class="nav-item ">
47        <a class="nav-link" href="../../">Home <span class="sr-only">(current)</span></a>
48      </li>
49      <li class="nav-item ">
50        <a class="nav-link" href="../../www/download.html">Download</a>
51      </li>
52      <li class="nav-item ">
53        <a class="nav-link" href="../../www/command-line-tools.html">Tools</a>
54      </li>
55      <li class="nav-item ">
56        <a class="nav-link" href="../../www/command-line-processing.html">Command-line</a>
57      </li>
58      <li class="nav-item ">
59        <a class="nav-link" href="../../www/resources.html">Resources</a>
60      </li>
61      <li class="nav-item ">
62        <a class="nav-link" href="../../www/develop.html">Develop</a>
63      </li>
64      <li class="nav-item">
65        <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a>
66      </li>
67    </ul>
68    <form class="form-inline my-2 my-lg-0" action="../https://imagemagick.org/script/search.php">
69      <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
70      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
71    </form>
72    </div>
73  </nav>
74  <div class="container">
75   <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
76         style="display:block"
77         data-ad-client="ca-pub-3129977114552745"
78         data-ad-slot="6345125851"
79         data-full-width-responsive="true"
80         data-ad-format="horizontal"></ins>
81    <script>
82      (adsbygoogle = window.adsbygoogle || []).push({});
83    </script>
84
85  </div>
86
87  <main class="container">
88    <div class="magick-template">
89<div class="magick-header">
90<p class="text-center"><a href="blob.html#BlobToImage">BlobToImage</a> &#8226; <a href="blob.html#CustomStreamToImage">CustomStreamToImage</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>
91
92<h2><a href="../../api/MagickCore/blob_8c.html" id="BlobToImage">BlobToImage</a></h2>
93
94<p>BlobToImage() implements direct to memory image formats.  It returns the blob as an image.</p>
95
96<p>The format of the BlobToImage method is:</p>
97
98<pre class="text">
99Image *BlobToImage(const ImageInfo *image_info,const void *blob,
100  const size_t length,ExceptionInfo *exception)
101</pre>
102
103<p>A description of each parameter follows:</p>
104
105<dd>
106</dd>
107
108<dd> </dd>
109<dl class="dl-horizontal">
110<dt>image_info</dt>
111<dd>the image info. </dd>
112
113<dd> </dd>
114<dt>blob</dt>
115<dd>the address of a character stream in one of the image formats understood by ImageMagick. </dd>
116
117<dd> </dd>
118<dt>length</dt>
119<dd>This size_t integer reflects the length in bytes of the blob. </dd>
120
121<dd> </dd>
122<dt>exception</dt>
123<dd>return any errors or warnings in this structure. </dd>
124
125<dd>  </dd>
126</dl>
127<h2><a href="../../api/MagickCore/blob_8c.html" id="CustomStreamToImage">CustomStreamToImage</a></h2>
128
129<p>CustomStreamToImage() is the equivalent of ReadImage(), but reads the formatted "file" from the suplied method rather than to an actual file.</p>
130
131<p>The format of the CustomStreamToImage method is:</p>
132
133<pre class="text">
134Image *CustomStreamToImage(const ImageInfo *image_info,
135   ExceptionInfo *exception)
136</pre>
137
138<p>A description of each parameter follows:</p>
139
140<dd>
141</dd>
142
143<dd> </dd>
144<dl class="dl-horizontal">
145<dt>image_info</dt>
146<dd>the image info. </dd>
147
148<dd> </dd>
149<dt>exception</dt>
150<dd>return any errors or warnings in this structure. </dd>
151
152<dd>  </dd>
153</dl>
154<h2><a href="../../api/MagickCore/blob_8c.html" id="FileToBlob">FileToBlob</a></h2>
155
156<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>
157
158<p>The format of the FileToBlob method is:</p>
159
160<pre class="text">
161void *FileToBlob(const char *filename,const size_t extent,
162  size_t *length,ExceptionInfo *exception)
163</pre>
164
165<p>A description of each parameter follows:</p>
166
167<dd>
168</dd>
169
170<dd> </dd>
171<dl class="dl-horizontal">
172<dt>blob</dt>
173<dd> FileToBlob() returns the contents of a file as a blob.  If an error occurs NULL is returned. </dd>
174
175<dd> </dd>
176<dt>filename</dt>
177<dd>the filename. </dd>
178
179<dd> </dd>
180<dt>extent</dt>
181<dd> The maximum length of the blob. </dd>
182
183<dd> </dd>
184<dt>length</dt>
185<dd>On return, this reflects the actual length of the blob. </dd>
186
187<dd> </dd>
188<dt>exception</dt>
189<dd>return any errors or warnings in this structure. </dd>
190
191<dd>  </dd>
192</dl>
193<h2><a href="../../api/MagickCore/blob_8c.html" id="FileToImage">FileToImage</a></h2>
194
195<p>FileToImage() write the contents of a file to an image.</p>
196
197<p>The format of the FileToImage method is:</p>
198
199<pre class="text">
200MagickBooleanType FileToImage(Image *,const char *filename)
201</pre>
202
203<p>A description of each parameter follows:</p>
204
205<dd>
206</dd>
207
208<dd> </dd>
209<dl class="dl-horizontal">
210<dt>image</dt>
211<dd>the image. </dd>
212
213<dd> </dd>
214<dt>filename</dt>
215<dd>the filename. </dd>
216
217<dd>  </dd>
218</dl>
219<h2><a href="../../api/MagickCore/blob_8c.html" id="GetBlobProperties">GetBlobProperties</a></h2>
220
221<p>GetBlobProperties() returns information about an image blob.</p>
222
223<p>The format of the GetBlobProperties method is:</p>
224
225<pre class="text">
226const struct stat *GetBlobProperties(const Image *image)
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</dl>
241<h2><a href="../../api/MagickCore/blob_8c.html" id="ImageToBlob">ImageToBlob</a></h2>
242
243<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>
244
245<p>The format of the ImageToBlob method is:</p>
246
247<pre class="text">
248void *ImageToBlob(const ImageInfo *image_info,Image *image,
249  size_t *length,ExceptionInfo *exception)
250</pre>
251
252<p>A description of each parameter follows:</p>
253
254<dd>
255</dd>
256
257<dd> </dd>
258<dl class="dl-horizontal">
259<dt>image_info</dt>
260<dd>the image info. </dd>
261
262<dd> </dd>
263<dt>image</dt>
264<dd>the image. </dd>
265
266<dd> </dd>
267<dt>length</dt>
268<dd>return the actual length of the blob. </dd>
269
270<dd> </dd>
271<dt>exception</dt>
272<dd>return any errors or warnings in this structure. </dd>
273
274<dd>  </dd>
275</dl>
276<h2><a href="../../api/MagickCore/blob_8c.html" id="ImageToFile">ImageToFile</a></h2>
277
278<p>ImageToFile() writes an image to a file.  It returns MagickFalse if an error occurs otherwise MagickTrue.</p>
279
280<p>The format of the ImageToFile method is:</p>
281
282<pre class="text">
283 MagickBooleanType ImageToFile(Image *image,char *filename,
284   ExceptionInfo *exception)
285</pre>
286
287<p>A description of each parameter follows:</p>
288
289<dd>
290</dd>
291
292<dd> </dd>
293<dl class="dl-horizontal">
294<dt>image</dt>
295<dd>the image. </dd>
296
297<dd> </dd>
298<dt>filename</dt>
299<dd>Write the image to this file. </dd>
300
301<dd> </dd>
302<dt>exception</dt>
303<dd>return any errors or warnings in this structure. </dd>
304
305<dd>  </dd>
306</dl>
307<h2><a href="../../api/MagickCore/blob_8c.html" id="ImagesToBlob">ImagesToBlob</a></h2>
308
309<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>
310
311<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>
312
313<p>The format of the ImagesToBlob method is:</p>
314
315<pre class="text">
316void *ImagesToBlob(const ImageInfo *image_info,Image *images,
317  size_t *length,ExceptionInfo *exception)
318</pre>
319
320<p>A description of each parameter follows:</p>
321
322<dd>
323</dd>
324
325<dd> </dd>
326<dl class="dl-horizontal">
327<dt>image_info</dt>
328<dd>the image info. </dd>
329
330<dd> </dd>
331<dt>images</dt>
332<dd>the image list. </dd>
333
334<dd> </dd>
335<dt>length</dt>
336<dd>return the actual length of the blob. </dd>
337
338<dd> </dd>
339<dt>exception</dt>
340<dd>return any errors or warnings in this structure. </dd>
341
342<dd>  </dd>
343</dl>
344<h2><a href="../../api/MagickCore/blob_8c.html" id="InjectImageBlob">InjectImageBlob</a></h2>
345
346<p>InjectImageBlob() injects the image with a copy of itself in the specified format (e.g. inject JPEG into a PDF image).</p>
347
348<p>The format of the InjectImageBlob method is:</p>
349
350<pre class="text">
351MagickBooleanType InjectImageBlob(const ImageInfo *image_info,
352  Image *image,Image *inject_image,const char *format,
353  ExceptionInfo *exception)
354</pre>
355
356<p>A description of each parameter follows:</p>
357
358<dd>
359</dd>
360
361<dd> </dd>
362<dl class="dl-horizontal">
363<dt>image_info</dt>
364<dd>the image info.. </dd>
365
366<dd> </dd>
367<dt>image</dt>
368<dd>the image. </dd>
369
370<dd> </dd>
371<dt>inject_image</dt>
372<dd>inject into the image stream. </dd>
373
374<dd> </dd>
375<dt>format</dt>
376<dd>the image format. </dd>
377
378<dd> </dd>
379<dt>exception</dt>
380<dd>return any errors or warnings in this structure. </dd>
381
382<dd>  </dd>
383</dl>
384<h2><a href="../../api/MagickCore/blob_8c.html" id="IsBlobExempt">IsBlobExempt</a></h2>
385
386<p>IsBlobExempt() returns true if the blob is exempt.</p>
387
388<p>The format of the IsBlobExempt method is:</p>
389
390<pre class="text">
391 MagickBooleanType IsBlobExempt(const Image *image)
392</pre>
393
394<p>A description of each parameter follows:</p>
395
396<dd>
397</dd>
398
399<dd> </dd>
400<dl class="dl-horizontal">
401<dt>image</dt>
402<dd>the image. </dd>
403
404<dd>  </dd>
405</dl>
406<h2><a href="../../api/MagickCore/blob_8c.html" id="IsBlobSeekable">IsBlobSeekable</a></h2>
407
408<p>IsBlobSeekable() returns true if the blob is seekable.</p>
409
410<p>The format of the IsBlobSeekable method is:</p>
411
412<pre class="text">
413 MagickBooleanType IsBlobSeekable(const Image *image)
414</pre>
415
416<p>A description of each parameter follows:</p>
417
418<dd>
419</dd>
420
421<dd> </dd>
422<dl class="dl-horizontal">
423<dt>image</dt>
424<dd>the image. </dd>
425
426<dd>  </dd>
427</dl>
428<h2><a href="../../api/MagickCore/blob_8c.html" id="IsBlobTemporary">IsBlobTemporary</a></h2>
429
430<p>IsBlobTemporary() returns true if the blob is temporary.</p>
431
432<p>The format of the IsBlobTemporary method is:</p>
433
434<pre class="text">
435 MagickBooleanType IsBlobTemporary(const Image *image)
436</pre>
437
438<p>A description of each parameter follows:</p>
439
440<dd>
441</dd>
442
443<dd> </dd>
444<dl class="dl-horizontal">
445<dt>image</dt>
446<dd>the image. </dd>
447
448<dd>  </dd>
449</dl>
450</div>
451    </div>
452  </main><!-- /.container -->
453  <footer class="magick-footer">
454    <p><a href="../../www/security-policy.html">Security</a> •
455    <a href="../../www/architecture.html">Architecture</a>
456
457    <a href="blob.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../images/wand.ico"/></a>
458
459    <a href="../../www/links.html">Related</a> •
460     <a href="../../www/sitemap.html">Sitemap</a>
461    <br/>
462    <a href="../../www/support.html">Donate</a> •
463    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
464    <a href="../../www/contact.html">Contact Us</a>
465    <br/>
466    <small>© 1999-2020 ImageMagick Studio LLC</small></p>
467  </footer>
468
469  <!-- Javascript assets -->
470  <script src="../assets/magick.js" crossorigin="anonymous"></script>
471  <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.4.1/jquery.min.js"><\/script>')</script>
472</body>
473</html>
474<!-- Magick Cache 5th January 2020 00:27 -->