/usr/share/gtk-doc/html/libiptcdata/iptc-libjpeg.html is in libiptcdata-doc 1.0.4-4.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>libiptcdata Reference Manual: libjpeg Interoperability</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="index.html" title="libiptcdata Reference Manual">
<link rel="prev" href="iptc-overview.html" title="libiptcdata Overview">
<link rel="next" href="iptc-i18n.html" title="Internationalization">
<meta name="generator" content="GTK-Doc V1.20 (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="10"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="iptc-overview.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="iptc-i18n.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="iptc-libjpeg"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">libjpeg Interoperability</span></h2>
<p>libjpeg Interoperability — an example of using libiptcdata together with libjpeg</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="i18n"></a><h2>Reading IPTC data from a file parsed with libjpeg</h2>
<p>
libjpeg is a popular library for parsing jpeg files because
it is free, fast, and widely available on many platforms. It
is easy to combine libiptcdata with code that already uses
libjpeg to decompress a jpeg file. The following example shows
how to extract IPTC data while a file is being parsed by libjpeg:
</p>
<pre class="programlisting">
IptcData *d;
struct jpeg_decompress_struct cinfo;
struct jpeg_error_mgr jerr;
FILE * infile;
int ps3_pos = 0, ps3_len;
jpeg_saved_marker_ptr marker;
infile = fopen (path, "r");
if (!infile)
return -1;
/* decompress the jpeg */
cinfo.err = jpeg_std_error (&jerr);
jpeg_create_decompress (&cinfo);
jpeg_stdio_src (&cinfo, infile);
/* be sure to save the APP13 header, which might contain IPTC data */
jpeg_save_markers (&cinfo, JPEG_APP0+13, 0xffff);
jpeg_read_header (&cinfo, TRUE);
/* look for an IPTC header */
marker = cinfo.marker_list;
while (marker) {
if (marker->marker == JPEG_APP0+13) {
ps3_pos = iptc_jpeg_ps3_find_iptc (marker->data,
marker->data_length, &ps3_len);
if (ps3_pos > 0)
break;
}
marker = marker->next;
}
if (!marker) {
/* clean up if we don't find IPTC data */
jpeg_destroy_decompress (&cinfo);
fclose (infile);
return 0;
}
/* parse the IPTC data */
d = iptc_data_new_from_data (marker->data + ps3_pos, ps3_len);
/* clean up */
jpeg_destroy_decompress (&cinfo);
fclose (infile);
</pre>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.20</div>
</body>
</html>
|