• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8    <title>ImageMagick: MagickCore, C API for ImageMagick: Get/Set Image Properties</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 Bézier 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:, get/set, image, properties, 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="property.html#CloneImageProperties">CloneImageProperties</a> &#8226; <a href="property.html#DefineImageProperty">DefineImageProperty</a> &#8226; <a href="property.html#DeleteImageProperty">DeleteImageProperty</a> &#8226; <a href="property.html#DestroyImageProperties">DestroyImageProperties</a> &#8226; <a href="property.html#FormatImageProperty">FormatImageProperty</a> &#8226; <a href="property.html#GetImageProperty">GetImageProperty</a> &#8226; <a href="property.html#GetNextImageProperty">GetNextImageProperty</a> &#8226; <a href="property.html#InterpretImageProperties">InterpretImageProperties</a> &#8226; <a href="property.html#RemoveImageProperty">RemoveImageProperty</a> &#8226; <a href="property.html#ResetImagePropertyIterator">ResetImagePropertyIterator</a> &#8226; <a href="property.html#SetImageProperty">SetImageProperty</a></p>
60
61<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="CloneImageProperties">CloneImageProperties</a></h2>
62
63<p>CloneImageProperties() clones all the image properties to another image.</p>
64
65<p>The format of the CloneImageProperties method is:</p>
66
67<pre class="text">
68MagickBooleanType CloneImageProperties(Image *image,
69  const Image *clone_image)
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</dt>
80<dd>the image. </dd>
81
82<dd> </dd>
83<dt>clone_image</dt>
84<dd>the clone image. </dd>
85
86<dd>  </dd>
87</dl>
88<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="DefineImageProperty">DefineImageProperty</a></h2>
89
90<p>DefineImageProperty() associates an assignment string of the form "key=value" with an artifact or options. It is equivelent to SetImageProperty()</p>
91
92<p>The format of the DefineImageProperty method is:</p>
93
94<pre class="text">
95MagickBooleanType DefineImageProperty(Image *image,const char *property,
96  ExceptionInfo *exception)
97</pre>
98
99<p>A description of each parameter follows:</p>
100
101<dd>
102</dd>
103
104<dd> </dd>
105<dl class="dl-horizontal">
106<dt>image</dt>
107<dd>the image. </dd>
108
109<dd> </dd>
110<dt>property</dt>
111<dd>the image property. </dd>
112
113<dd> </dd>
114<dt>exception</dt>
115<dd>return any errors or warnings in this structure. </dd>
116
117<dd>  </dd>
118</dl>
119<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="DeleteImageProperty">DeleteImageProperty</a></h2>
120
121<p>DeleteImageProperty() deletes an image property.</p>
122
123<p>The format of the DeleteImageProperty method is:</p>
124
125<pre class="text">
126MagickBooleanType DeleteImageProperty(Image *image,const char *property)
127</pre>
128
129<p>A description of each parameter follows:</p>
130
131<dd>
132</dd>
133
134<dd> </dd>
135<dl class="dl-horizontal">
136<dt>image</dt>
137<dd>the image. </dd>
138
139<dd> </dd>
140<dt>property</dt>
141<dd>the image property. </dd>
142
143<dd>  </dd>
144</dl>
145<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="DestroyImageProperties">DestroyImageProperties</a></h2>
146
147<p>DestroyImageProperties() destroys all properties and associated memory attached to the given image.</p>
148
149<p>The format of the DestroyDefines method is:</p>
150
151<pre class="text">
152void DestroyImageProperties(Image *image)
153</pre>
154
155<p>A description of each parameter follows:</p>
156
157<dd>
158</dd>
159
160<dd> </dd>
161<dl class="dl-horizontal">
162<dt>image</dt>
163<dd>the image. </dd>
164
165<dd>  </dd>
166</dl>
167<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="FormatImageProperty">FormatImageProperty</a></h2>
168
169<p>FormatImageProperty() permits formatted property/value pairs to be saved as an image property.</p>
170
171<p>The format of the FormatImageProperty method is:</p>
172
173<pre class="text">
174MagickBooleanType FormatImageProperty(Image *image,const char *property,
175  const char *format,...)
176</pre>
177
178<p>A description of each parameter follows.</p>
179
180<dt> image</dt>
181<p>The image.</p>
182
183<dt> property</dt>
184<p>The attribute property.</p>
185
186<dt> format</dt>
187<p>A string describing the format to use to write the remaining arguments.</p>
188
189<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="GetImageProperty">GetImageProperty</a></h2>
190
191<p>GetImageProperty() gets a value associated with an image property.</p>
192
193<p>This includes,  profile prefixes, such as "exif:", "iptc:" and "8bim:" It does not handle non-prifile prefixes, such as "fx:", "option:", or "artifact:".</p>
194
195<p>The returned string is stored as a properity of the same name for faster lookup later. It should NOT be freed by the caller.</p>
196
197<p>The format of the GetImageProperty method is:</p>
198
199<pre class="text">
200const char *GetImageProperty(const Image *image,const char *key,
201  ExceptionInfo *exception)
202</pre>
203
204<p>A description of each parameter follows:</p>
205
206<dd>
207</dd>
208
209<dd> </dd>
210<dl class="dl-horizontal">
211<dt>image</dt>
212<dd>the image. </dd>
213
214<dd> </dd>
215<dt>key</dt>
216<dd>the key. </dd>
217
218<dd> </dd>
219<dt>exception</dt>
220<dd>return any errors or warnings in this structure. </dd>
221
222<dd>  </dd>
223</dl>
224<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="GetNextImageProperty">GetNextImageProperty</a></h2>
225
226<p>GetNextImageProperty() gets the next free-form string property name.</p>
227
228<p>The format of the GetNextImageProperty method is:</p>
229
230<pre class="text">
231char *GetNextImageProperty(const Image *image)
232</pre>
233
234<p>A description of each parameter follows:</p>
235
236<dd>
237</dd>
238
239<dd> </dd>
240<dl class="dl-horizontal">
241<dt>image</dt>
242<dd>the image. </dd>
243
244<dd>  </dd>
245</dl>
246<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="InterpretImageProperties">InterpretImageProperties</a></h2>
247
248<p>InterpretImageProperties() replaces any embedded formatting characters with the appropriate image property and returns the interpreted text.</p>
249
250<p>This searches for and replaces \n \r \          replaced by newline, return, and percent resp. &amp;lt; &amp;gt; &amp;amp;   replaced by '&lt;', '&gt;', '&amp;' resp. replaced by percent</p>
251
252<p>x [x]       where 'x' is a single letter properity, case sensitive). [type:name]  where 'type' a is special and known prefix. [name]       where 'name' is a specifically known attribute, calculated value, or a per-image property string name, or a per-image 'artifact' (as generated from a global option). It may contain ':' as long as the prefix is not special.</p>
253
254<p>Single letter  substitutions will only happen if the character before the percent is NOT a number. But braced substitutions will always be performed. This prevents the typical usage of percent in a interpreted geometry argument from being substituted when the percent is a geometry flag.</p>
255
256<p>If 'glob-expresions' ('*' or '?' characters) is used for 'name' it may be used as a search pattern to print multiple lines of "name=value\n" pairs of the associacted set of properties.</p>
257
258<p>The returned string must be freed using DestoryString() by the caller.</p>
259
260<p>The format of the InterpretImageProperties method is:</p>
261
262<pre class="text">
263char *InterpretImageProperties(ImageInfo *image_info,
264  Image *image,const char *embed_text,ExceptionInfo *exception)
265</pre>
266
267<p>A description of each parameter follows:</p>
268
269<dd>
270</dd>
271
272<dd> </dd>
273<dl class="dl-horizontal">
274<dt>image_info</dt>
275<dd>the image info. (required) </dd>
276
277<dd> </dd>
278<dt>image</dt>
279<dd>the image. (optional) </dd>
280
281<dd> </dd>
282<dt>embed_text</dt>
283<dd>the address of a character string containing the embedded formatting characters. </dd>
284
285<dd> </dd>
286<dt>exception</dt>
287<dd>return any errors or warnings in this structure. </dd>
288
289<dd>  </dd>
290</dl>
291<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="RemoveImageProperty">RemoveImageProperty</a></h2>
292
293<p>RemoveImageProperty() removes a property from the image and returns its value.</p>
294
295<p>In this case the ConstantString() value returned should be freed by the caller when finished.</p>
296
297<p>The format of the RemoveImageProperty method is:</p>
298
299<pre class="text">
300char *RemoveImageProperty(Image *image,const char *property)
301</pre>
302
303<p>A description of each parameter follows:</p>
304
305<dd>
306</dd>
307
308<dd> </dd>
309<dl class="dl-horizontal">
310<dt>image</dt>
311<dd>the image. </dd>
312
313<dd> </dd>
314<dt>property</dt>
315<dd>the image property. </dd>
316
317<dd>  </dd>
318</dl>
319<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="ResetImagePropertyIterator">ResetImagePropertyIterator</a></h2>
320
321<p>ResetImagePropertyIterator() resets the image properties iterator.  Use it in conjunction with GetNextImageProperty() to iterate over all the values associated with an image property.</p>
322
323<p>The format of the ResetImagePropertyIterator method is:</p>
324
325<pre class="text">
326ResetImagePropertyIterator(Image *image)
327</pre>
328
329<p>A description of each parameter follows:</p>
330
331<dd>
332</dd>
333
334<dd> </dd>
335<dl class="dl-horizontal">
336<dt>image</dt>
337<dd>the image. </dd>
338
339<dd>  </dd>
340</dl>
341<h2><a href="http://www.imagemagick.org/api/MagickCore/property_8c.html" id="SetImageProperty">SetImageProperty</a></h2>
342
343<p>SetImageProperty() saves the given string value either to specific known attribute or to a freeform property string.</p>
344
345<p>Attempting to set a property that is normally calculated will produce an exception.</p>
346
347<p>The format of the SetImageProperty method is:</p>
348
349<pre class="text">
350MagickBooleanType SetImageProperty(Image *image,const char *property,
351  const char *value,ExceptionInfo *exception)
352</pre>
353
354<p>A description of each parameter follows:</p>
355
356<dd>
357</dd>
358
359<dd> </dd>
360<dl class="dl-horizontal">
361<dt>image</dt>
362<dd>the image. </dd>
363
364<dd> </dd>
365<dt>property</dt>
366<dd>the image property. </dd>
367
368<dd> </dd>
369<dt>values</dt>
370<dd>the image property values. </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</div>
379  <footer class="magick-footer">
380    <p><a href="../support.html">Donate</a> •
381     <a href="../sitemap.html">Sitemap</a> •
382    <a href="../links.html">Related</a> •
383    <a href="../architecture.html">Architecture</a>
384</p>
385    <p><a href="property.html#">Back to top</a> •
386    <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
387    <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
388        <p><small>©  1999-2016 ImageMagick Studio LLC</small></p>
389  </footer>
390</div><!-- /.container -->
391
392  <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
393  <script src="../js/magick.html"></script>
394</div>
395</body>
396</html>
397