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