Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > c109337651527e96d7bb9adc83c5b18a > files > 418

libvips-devel-7.18.2-1mdv2010.0.i586.rpm

<!-- manual page source format generated by PolyglotMan v3.2, -->
<!-- available at http://polyglotman.sourceforge.net/ -->

<html>
<head>
<title>IM_META(3) manual page</title>
</head>
<body bgcolor='white'>
<a href='#toc'>Table of Contents</a><p>

<h2><a name='sect0' href='#toc0'>Name</a></h2>
im_meta_set_int, im_meta_get_int, im_meta_set_double, im_meta_get_double,
im_meta_set_area, im_meta_get_area, im_meta_set_string, im_meta_get_string,
im_meta_set_blob, im_meta_get_blob, im_meta_set, im_meta_get - read and
write extra header fields 
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
#include &lt;vips/vips.h&gt; 
<p> int im_meta_set_int(
IMAGE *im, const char *field, int i ); <br>
int im_meta_get_int( IMAGE *im, const char *field, int *i ); <br>
int im_meta_set_double( IMAGE *im, const char *field, double d ); <br>
int im_meta_get_double( IMAGE *im, const char *field, double *d ); <br>
int im_meta_set_area( IMAGE *im, const char *field,    im_callback_fn free_fn,
void *data );<br>
 <br>
int im_meta_get_area( IMAGE *im, const char *field, void **data ); <br>
int im_meta_set_string( IMAGE *im, const char *field,    const char *str
);<br>
 <br>
int im_meta_get_string( IMAGE *im, const char *field, char **str ); <br>
int im_meta_set_blob( IMAGE *im, const char *field,    im_callback_fn free_fn,
void *blob, size_t blob_length );<br>
 <br>
int im_meta_get_blob( IMAGE *im, const char *field,    void **blob, size_t
*blob_length );<br>
 
<p> typedef int (*im_callback_fn)( void *, void * ); 
<p> int im_meta_set( IMAGE
*im, const char *field, GValue *value ); <br>
int im_meta_get( IMAGE *im, const char *field, GValue *value_copy ); <br>
GType im_meta_get_type( IMAGE *im, const char *field ); 
<p> #define IM_TYPE_SAVE_STRING
(im_save_string_get_type()) <br>
GType im_save_string_get_type( void ); <br>
const char *im_save_string_get( const GValue *value ); <br>
void im_save_string_set( GValue *value, const char *str ); <br>
void im_save_string_setf( GValue *value, const char *fmt, ... ); 
<p> 
<h2><a name='sect2' href='#toc2'>Description</a></h2>
These
functions read and write extra image header fields. Writing to a field destroys
any old value. You must read a field with the correct type of reader: you
can&rsquo;t read an int field as a string. Fields are copied when images are processed,
so you can use them to pass information to subsequent operations. Unless
otherwise noted, image header fields created with these functions are also
saved to disc when an image is saved in VIPS format, and automatically
restored when the image is loaded again. 
<p> <a href='im_meta_set_int.3.html'><b>im_meta_set_int(3)</b></a>
 sets an integer
field. Any existing field of any type with this name is  removed. It returns
0 for success, or -1 on error setting  <a href='im_error.3.html'><b>im_error(3)</a>
.</b> 
<p> <a href='im_meta_get_int.3.html'><b>im_meta_get_int(3)</b></a>
 reads
an integer field. It returns 0 for success, or -1 on error, setting <a href='im_error.3.html'><b>im_error(3)</a>
.
</b> It can fail if the field does not exist, or if the field is not an int.

<p> <a href='im_meta_set_double.3.html'><b>im_meta_set_double(3)</b></a>
 and <a href='im_meta_get_double.3.html'><b>im_meta_get_double(3)</b></a>
 work exactly as  <a href='im_meta_set_int.3.html'><b>im_meta_set_int(3)</b></a>

and <a href='im_meta_get_int.3.html'><b>im_meta_get_int(3)</a>
.</b> 
<p> <a href='im_meta_set_area.3.html'><b>im_meta_set_area(3)</b></a>
 sets a field which is an area
of memory. When the field is copied to a subsequent IMAGE, VIPS just copies
the pointer. VIPS keeps a reference count and when the last IMAGE using
this field is closed, VIPS will call  <b>free_fn</b> to release the memory. You
can therefore use this function to attach very large areas of memory to
images efficiently. Areas cannot be saved to VIPS files on disc, since there
is no known length.  
<p> <a href='im_meta_set_string.3.html'><b>im_meta_set_string(3)</b></a>
 is a convenience function over
 <a href='im_meta_set_area.3.html'><b>im_meta_set_area(3)</a>
. </b> It copies the string, and then shares that copy between
all images derived from this IMAGE.  
<p> <a href='im_meta_get_string.3.html'><b>im_meta_get_string(3)</b></a>
 is a convenience
function over  <a href='im_meta_get_area.3.html'><b>im_meta_get_area(3)</a>
. </b> It returns a pointer to the string
being mananged by VIPS. Do not free the return result! 
<p> <a href='im_meta_set_blob.3.html'><b>im_meta_set_blob(3)</b></a>

sets a field which is a blob (binary object). A blob is just like string,
 except that rather than being NULL-terminated, you must pass an explicit
 length.  
<p> <a href='im_meta_set.3.html'><b>im_meta_set(3)</a>
,</b> <a href='im_meta_get_type.3.html'><b>im_meta_get_type(3)</b></a>
 and <a href='im_meta_get.3.html'><b>im_meta_get(3)</b></a>
 operate
at a lower level: they let you set image header fields as GValue. Use one
of the convenience functions above if possible.  <a href='im_meta_get_type.3.html'><b>im_meta_get_type(3)</b></a>
 returns
0 if the field is not defined. 
<p> In order for the autoload/save to VIPS files
to work, you need to use a GType with a transform defined to and from 
<b>IM_TYPE_SAVE_STRING.</b> 
<p> 
<h2><a name='sect3' href='#toc3'>Return Value</a></h2>
The functions return 0 success and -1 on
error. 
<h2><a name='sect4' href='#toc4'>See Also</a></h2>
<a href='im_header_int.3.html'>im_header_int(3)</a>
, <a href='im_header_map.3.html'>im_header_map(3)</a>
. 
<h2><a name='sect5' href='#toc5'>Copyright</a></h2>
The National
Gallery, 2005. 
<h2><a name='sect6' href='#toc6'>Author</a></h2>
Markus Wollgarten and John Cupitt  <p>

<hr><p>
<a name='toc'><b>Table of Contents</b></a><p>
<ul>
<li><a name='toc0' href='#sect0'>Name</a></li>
<li><a name='toc1' href='#sect1'>Synopsis</a></li>
<li><a name='toc2' href='#sect2'>Description</a></li>
<li><a name='toc3' href='#sect3'>Return Value</a></li>
<li><a name='toc4' href='#sect4'>See Also</a></li>
<li><a name='toc5' href='#sect5'>Copyright</a></li>
<li><a name='toc6' href='#sect6'>Author</a></li>
</ul>
</body>
</html>