/usr/share/gtk-doc/html/libiptcdata/libiptcdata-jpeg.html is in libiptcdata-doc 1.0.4-3ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JPEG</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="libiptcdata Reference Manual">
<link rel="up" href="ch02.html" title="Format-specific Functions">
<link rel="prev" href="ch02.html" title="Format-specific Functions">
<link rel="next" href="ch03.html" title="Helper Functions">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch02.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libiptcdata Reference Manual</th>
<td><a accesskey="n" href="ch03.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libiptcdata-jpeg.synopsis" class="shortcut">Top</a>
|
<a href="#libiptcdata-jpeg.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libiptcdata-jpeg"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libiptcdata-jpeg.top_of_page"></a>JPEG</span></h2>
<p>JPEG — functions for loading and saving IPTC data from JPEG files</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libiptcdata-jpeg.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><span class="returnvalue">int</span> <a class="link" href="libiptcdata-jpeg.html#iptc-jpeg-read-ps3" title="iptc_jpeg_read_ps3 ()">iptc_jpeg_read_ps3</a> (<em class="parameter"><code><span class="type">FILE</span> *infile</code></em>,
<em class="parameter"><code>unsigned <span class="type">char</span> *buf</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> size</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libiptcdata-jpeg.html#iptc-jpeg-ps3-find-iptc" title="iptc_jpeg_ps3_find_iptc ()">iptc_jpeg_ps3_find_iptc</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *ps3</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> ps3_size</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> *iptc_len</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libiptcdata-jpeg.html#iptc-jpeg-ps3-save-iptc" title="iptc_jpeg_ps3_save_iptc ()">iptc_jpeg_ps3_save_iptc</a> (<em class="parameter"><code>const unsigned <span class="type">char</span> *ps3</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> ps3_size</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *iptc</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> iptc_size</code></em>,
<em class="parameter"><code>unsigned <span class="type">char</span> *buf</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> size</code></em>);
<span class="returnvalue">int</span> <a class="link" href="libiptcdata-jpeg.html#iptc-jpeg-save-with-ps3" title="iptc_jpeg_save_with_ps3 ()">iptc_jpeg_save_with_ps3</a> (<em class="parameter"><code><span class="type">FILE</span> *infile</code></em>,
<em class="parameter"><code><span class="type">FILE</span> *outfile</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *ps3</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> ps3_size</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libiptcdata-jpeg.description"></a><h2>Description</h2>
<p>
Convenience functions for loading and saving IPTC data blocks from JPEG files.
</p>
</div>
<div class="refsect1">
<a name="libiptcdata-jpeg.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="iptc-jpeg-read-ps3"></a><h3>iptc_jpeg_read_ps3 ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> iptc_jpeg_read_ps3 (<em class="parameter"><code><span class="type">FILE</span> *infile</code></em>,
<em class="parameter"><code>unsigned <span class="type">char</span> *buf</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> size</code></em>);</pre>
<p>
Scans the headers of a JPEG file looking for a "Photoshop 3.0" header, and if
found, stores the raw contents of this header in the <em class="parameter"><code>buf</code></em> buffer. The Photoshop
3.0 header is a series of records found in the APP13 section of a JPEG file.
If a JPEG file contains IPTC metadata, the metadata is stored in one of the
Photoshop 3.0 records.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>infile</code></em> :</span></p></td>
<td>an open JPEG file with the current position set to the start of the file</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
<td>an output buffer to store the Photoshop 3.0 data</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td>the size of the output buffer</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of bytes stored on success, 0 if the PS3 header was
not found, or -1 if an error occurred.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="iptc-jpeg-ps3-find-iptc"></a><h3>iptc_jpeg_ps3_find_iptc ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> iptc_jpeg_ps3_find_iptc (<em class="parameter"><code>const unsigned <span class="type">char</span> *ps3</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> ps3_size</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> *iptc_len</code></em>);</pre>
<p>
Parses a "Photoshop 3.0" header in search of IPTC metadata.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>ps3</code></em> :</span></p></td>
<td>the data of a Photoshop 3.0 header to search</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ps3_size</code></em> :</span></p></td>
<td>size in bytes of <em class="parameter"><code>ps3</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>iptc_len</code></em> :</span></p></td>
<td>output parameter, the size in bytes of any found IPTC data</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the offset in bytes from the start of <em class="parameter"><code>ps3</code></em> where a block
of IPTC metadata begins, 0 if no IPTC metadata was found, -1 on error.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="iptc-jpeg-ps3-save-iptc"></a><h3>iptc_jpeg_ps3_save_iptc ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> iptc_jpeg_ps3_save_iptc (<em class="parameter"><code>const unsigned <span class="type">char</span> *ps3</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> ps3_size</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *iptc</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> iptc_size</code></em>,
<em class="parameter"><code>unsigned <span class="type">char</span> *buf</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> size</code></em>);</pre>
<p>
Takes a Photoshop 3.0 header, <em class="parameter"><code>ps3</code></em>, removes any existing IPTC data inside
that header, and inserts the new IPTC data from <em class="parameter"><code>iptc</code></em>. Any other non-IPTC
portions of <em class="parameter"><code>ps3</code></em> are left unmodified. If <em class="parameter"><code>ps3</code></em> is NULL, a blank PS3 header
is created. If <em class="parameter"><code>iptc</code></em> is NULL, the output PS3 header will contain no IPTC
data, even if <em class="parameter"><code>ps3</code></em> originally contained some.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>ps3</code></em> :</span></p></td>
<td>a template PS3 header in which to insert the
new iptc data. Any non-IPTC data in this template will be preserved
in the output Photoshop 3.0 header. If NULL, a PS3 header will be
generated from scratch.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ps3_size</code></em> :</span></p></td>
<td>size in bytes of <em class="parameter"><code>ps3</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>iptc</code></em> :</span></p></td>
<td>the IPTC bytestream to be encapsulated in the PS3 output. The IPTC
bytestream can be generated with <a class="link" href="libiptcdata-data.html#iptc-data-save" title="iptc_data_save ()"><code class="function">iptc_data_save()</code></a>. If
NULL, the output will still be a valid PS3 header, but without any
contained IPTC data.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>iptc_size</code></em> :</span></p></td>
<td>size in bytes of <em class="parameter"><code>iptc</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
<td>output buffer for the generated PS3 header</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td>size in bytes of <em class="parameter"><code>buf</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the number of bytes written to <em class="parameter"><code>buf</code></em>; -1 on error.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="iptc-jpeg-save-with-ps3"></a><h3>iptc_jpeg_save_with_ps3 ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span> iptc_jpeg_save_with_ps3 (<em class="parameter"><code><span class="type">FILE</span> *infile</code></em>,
<em class="parameter"><code><span class="type">FILE</span> *outfile</code></em>,
<em class="parameter"><code>const unsigned <span class="type">char</span> *ps3</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> ps3_size</code></em>);</pre>
<p>
Takes an existing JPEG file, <em class="parameter"><code>infile</code></em>, removes any existing Photoshop
3.0 header from it, and adds a new PS3 header, writing the output
to <em class="parameter"><code>outfile</code></em>. <em class="parameter"><code>infile</code></em> must be open for reading and is expected to point
to the beginning of the JPEG file, which should be different from <em class="parameter"><code>outfile</code></em>,
which must be open for writing. If <em class="parameter"><code>ps3</code></em> is NULL, the output will contain
no PS3 header. PS3 headers reside in the APP13 section of the JPEG file,
which is created if necessary. All other headers and data will be copied
directly from <em class="parameter"><code>infile</code></em> without modification.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>infile</code></em> :</span></p></td>
<td>the file stream from which the image data is copied</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>outfile</code></em> :</span></p></td>
<td>the output file stream</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ps3</code></em> :</span></p></td>
<td>the Photoshop 3.0 header to add to the output file</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ps3_size</code></em> :</span></p></td>
<td>size in bytes of <em class="parameter"><code>ps3</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>0 on success, -1 on error. Note that even in error, some data
may have been written to <em class="parameter"><code>outfile</code></em>, and its contents should be considered
undefined.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.19</div>
</body>
</html>
|