4
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
5
<title>gimpthumb-utils</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
7
7
<link rel="start" href="index.html" title="GIMP Thumbnail Library Reference Manual">
8
8
<link rel="up" href="libgimpthumb.html" title="Part I. GIMP Thumbnail Library">
9
9
<link rel="prev" href="GimpThumbnail.html" title="GimpThumbnail">
10
10
<link rel="next" href="libgimpthumb-gimpthumb-enums.html" title="gimpthumb-enums">
11
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.8 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="part" href="libgimpthumb.html" title="Part I. GIMP Thumbnail Library">
14
<link rel="index" href="libgimpthumb-index.html" title="Index">
15
<link rel="index" href="libgimpthumb-index-new-in-2-2.html" title="Index of new symbols in GIMP 2.2">
16
<link rel="index" href="libgimpthumb-index-new-in-2-4.html" title="Index of new symbols in GIMP 2.4">
17
<link rel="index" href="libgimpthumb-index-deprecated.html" title="Index of deprecated symbols">
15
19
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
16
20
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
21
25
<th width="100%" align="center">GIMP Thumbnail Library Reference Manual</th>
22
26
<td><a accesskey="n" href="libgimpthumb-gimpthumb-enums.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
24
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2560338" class="shortcut">Top</a>
28
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2593898" class="shortcut">Top</a>
26
<a href="#id2538172" class="shortcut">Description</a></nobr></td></tr>
30
<a href="#id2581316" class="shortcut">Description</a></nobr></td></tr>
28
32
<div class="refentry" lang="en">
29
33
<a name="libgimpthumb-gimpthumb-utils"></a><div class="titlepage"></div>
30
34
<div class="refnamediv"><table width="100%"><tr>
33
<a name="id2560338"></a><span class="refentrytitle">gimpthumb-utils</span>
37
<a name="id2593898"></a><span class="refentrytitle">gimpthumb-utils</span>
35
39
<p>gimpthumb-utils — Utility functions provided and used by libgimpthumb</p>
45
gboolean <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-init">gimp_thumb_init</a> (const gchar *creator,
46
const gchar *thumb_basedir);
47
gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-find-thumb">gimp_thumb_find_thumb</a> (const gchar *uri,
48
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> *size);
49
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbFileType">GimpThumbFileType</a> <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-file-test">gimp_thumb_file_test</a> (const gchar *filename,
53
gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-name-from-uri">gimp_thumb_name_from_uri</a> (const gchar *uri,
54
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);
55
gboolean <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-ensure-thumb-dir">gimp_thumb_ensure_thumb_dir</a> (<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size,
57
const gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-get-thumb-dir">gimp_thumb_get_thumb_dir</a> (<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);
58
void <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumbs-delete-for-uri">gimp_thumbs_delete_for_uri</a> (const gchar *uri);
59
gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-name-from-uri-local">gimp_thumb_name_from_uri_local</a> (const gchar *uri,
60
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);
61
gboolean <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-ensure-thumb-dir-local">gimp_thumb_ensure_thumb_dir_local</a>
62
(const gchar *dirname,
63
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size,
65
gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-get-thumb-dir-local">gimp_thumb_get_thumb_dir_local</a> (const gchar *dirname,
66
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);
67
void <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumbs-delete-for-uri-local">gimp_thumbs_delete_for_uri_local</a>
49
gboolean <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-init">gimp_thumb_init</a> (const gchar *creator,
50
const gchar *thumb_basedir);
51
gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-find-thumb">gimp_thumb_find_thumb</a> (const gchar *uri,
52
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> *size);
53
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbFileType">GimpThumbFileType</a> <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-file-test">gimp_thumb_file_test</a> (const gchar *filename,
57
gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-name-from-uri">gimp_thumb_name_from_uri</a> (const gchar *uri,
58
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);
59
gboolean <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-ensure-thumb-dir">gimp_thumb_ensure_thumb_dir</a> (<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size,
61
const gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-get-thumb-dir">gimp_thumb_get_thumb_dir</a> (<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);
62
void <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumbs-delete-for-uri">gimp_thumbs_delete_for_uri</a> (const gchar *uri);
63
gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-name-from-uri-local">gimp_thumb_name_from_uri_local</a> (const gchar *uri,
64
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);
65
gboolean <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-ensure-thumb-dir-local">gimp_thumb_ensure_thumb_dir_local</a> (const gchar *dirname,
66
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size,
68
gchar* <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-get-thumb-dir-local">gimp_thumb_get_thumb_dir_local</a> (const gchar *dirname,
69
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);
70
void <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumbs-delete-for-uri-local">gimp_thumbs_delete_for_uri_local</a> (const gchar *uri);
71
73
<div class="refsect1" lang="en">
72
<a name="id2538172"></a><h2>Description</h2>
74
<a name="id2581316"></a><h2>Description</h2>
77
79
<div class="refsect1" lang="en">
78
<a name="id2538188"></a><h2>Details</h2>
80
<a name="id2581332"></a><h2>Details</h2>
79
81
<div class="refsect2" lang="en">
80
<a name="id2538199"></a><h3>
82
<a name="id2581342"></a><h3>
81
83
<a name="gimp-thumb-init"></a>gimp_thumb_init ()</h3>
82
<a class="indexterm" name="id2538211"></a><pre class="programlisting">gboolean gimp_thumb_init (const gchar *creator,
83
const gchar *thumb_basedir);</pre>
84
<a class="indexterm" name="id2581355"></a><pre class="programlisting">gboolean gimp_thumb_init (const gchar *creator,
85
const gchar *thumb_basedir);</pre>
85
87
This function initializes the thumbnail system. It must be called
86
88
before any other functions from libgimpthumb are used. You may call
107
109
<col align="left" valign="top">
111
<span class="term"><em class="parameter"><code>creator</code></em> :</span></td>
112
<td><span class="term"><em class="parameter"><code>creator</code></em> :</span></td>
112
113
<td> an ASCII string that identifies the thumbnail creator
117
<span class="term"><em class="parameter"><code>thumb_basedir</code></em> :</span></td>
117
<td><span class="term"><em class="parameter"><code>thumb_basedir</code></em> :</span></td>
118
118
<td> an absolute path or <code class="literal">NULL</code> to use the default
123
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
122
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
124
123
<td> <code class="literal">TRUE</code> if the library was successfully initialized.
131
130
<div class="refsect2" lang="en">
132
<a name="id2528242"></a><h3>
131
<a name="id2577360"></a><h3>
133
132
<a name="gimp-thumb-find-thumb"></a>gimp_thumb_find_thumb ()</h3>
134
<a class="indexterm" name="id2528253"></a><pre class="programlisting">gchar* gimp_thumb_find_thumb (const gchar *uri,
135
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> *size);</pre>
133
<a class="indexterm" name="id2577371"></a><pre class="programlisting">gchar* gimp_thumb_find_thumb (const gchar *uri,
134
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> *size);</pre>
137
136
This function attempts to locate a thumbnail for the given
138
137
<em class="parameter"><code>uri</code></em>. First it tries the size that is stored at <em class="parameter"><code>size</code></em>. If no
155
154
<col align="left" valign="top">
159
<span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
157
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
160
158
<td> an escaped URI
165
<span class="term"><em class="parameter"><code>size</code></em> :</span></td>
162
<td><span class="term"><em class="parameter"><code>size</code></em> :</span></td>
166
163
<td> pointer to a <a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize"><span class="type">GimpThumbSize</span></a>
171
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
167
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
172
168
<td> a newly allocated string in the encoding of the
173
169
filesystem or <code class="literal">NULL</code> if no thumbnail for <em class="parameter"><code>uri</code></em> was found
195
191
<col align="left" valign="top">
199
<span class="term"><em class="parameter"><code>filename</code></em> :</span></td>
194
<td><span class="term"><em class="parameter"><code>filename</code></em> :</span></td>
200
195
<td> a filename in the encoding of the filesystem
205
<span class="term"><em class="parameter"><code>mtime</code></em> :</span></td>
199
<td><span class="term"><em class="parameter"><code>mtime</code></em> :</span></td>
206
200
<td> return location for modification time
211
<span class="term"><em class="parameter"><code>size</code></em> :</span></td>
204
<td><span class="term"><em class="parameter"><code>size</code></em> :</span></td>
212
205
<td> return location for file size
217
<span class="term"><em class="parameter"><code>err_no</code></em> :</span></td>
209
<td><span class="term"><em class="parameter"><code>err_no</code></em> :</span></td>
218
210
<td> return location for system "errno"
223
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
214
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
224
215
<td> The type of the file, or <a href="libgimpthumb-gimpthumb-enums.html#GIMP-THUMB-FILE-TYPE-NONE:CAPS"><span class="type">GIMP_THUMB_FILE_TYPE_NONE</span></a> if
225
216
the file doesn't exist.
232
223
<div class="refsect2" lang="en">
233
<a name="id2554992"></a><h3>
224
<a name="id2567082"></a><h3>
234
225
<a name="gimp-thumb-name-from-uri"></a>gimp_thumb_name_from_uri ()</h3>
235
<a class="indexterm" name="id2555004"></a><pre class="programlisting">gchar* gimp_thumb_name_from_uri (const gchar *uri,
236
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);</pre>
226
<a class="indexterm" name="id2567093"></a><pre class="programlisting">gchar* gimp_thumb_name_from_uri (const gchar *uri,
227
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);</pre>
238
229
Creates the name of the thumbnail file of the specified <em class="parameter"><code>size</code></em> that
239
230
belongs to an image file located at the given <em class="parameter"><code>uri</code></em>.</p>
244
235
<col align="left" valign="top">
248
<span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
238
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
249
239
<td> an escaped URI
254
<span class="term"><em class="parameter"><code>size</code></em> :</span></td>
243
<td><span class="term"><em class="parameter"><code>size</code></em> :</span></td>
255
244
<td> a <a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize"><span class="type">GimpThumbSize</span></a>
260
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
248
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
261
249
<td> a newly allocated filename in the encoding of the
262
250
filesystem or <code class="literal">NULL</code> if <em class="parameter"><code>uri</code></em> points to the user's
263
251
thumbnail repository.
288
276
<col align="left" valign="top">
292
<span class="term"><em class="parameter"><code>size</code></em> :</span></td>
279
<td><span class="term"><em class="parameter"><code>size</code></em> :</span></td>
293
280
<td> a GimpThumbSize
298
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
284
<td><span class="term"><em class="parameter"><code>error</code></em> :</span></td>
299
285
<td> return location for possible errors
304
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
289
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
305
290
<td> <code class="literal">TRUE</code> is the directory exists, <code class="literal">FALSE</code> if it could not
353
336
<div class="variablelist"><table border="0">
354
337
<col align="left" valign="top">
357
<span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
339
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
358
340
<td> an escaped URI
344
<p class="since">Since GIMP 2.2
366
348
<div class="refsect2" lang="en">
367
<a name="id2568629"></a><h3>
349
<a name="id2601719"></a><h3>
368
350
<a name="gimp-thumb-name-from-uri-local"></a>gimp_thumb_name_from_uri_local ()</h3>
369
<a class="indexterm" name="id2568643"></a><pre class="programlisting">gchar* gimp_thumb_name_from_uri_local (const gchar *uri,
370
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);</pre>
351
<a class="indexterm" name="id2601733"></a><pre class="programlisting">gchar* gimp_thumb_name_from_uri_local (const gchar *uri,
352
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);</pre>
372
354
Creates the name of a local thumbnail file of the specified <em class="parameter"><code>size</code></em>
373
355
that belongs to an image file located at the given <em class="parameter"><code>uri</code></em>. Local
379
361
<col align="left" valign="top">
383
<span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
364
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
384
365
<td> an escaped URI
389
<span class="term"><em class="parameter"><code>size</code></em> :</span></td>
369
<td><span class="term"><em class="parameter"><code>size</code></em> :</span></td>
390
370
<td> a <a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize"><span class="type">GimpThumbSize</span></a>
395
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
374
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
396
375
<td> a newly allocated filename in the encoding of the
397
376
filesystem or <code class="literal">NULL</code> if <em class="parameter"><code>uri</code></em> is a remote file or
398
377
points to the user's thumbnail repository.
383
<p class="since">Since GIMP 2.2
408
387
<div class="refsect2" lang="en">
409
<a name="id2568767"></a><h3>
388
<a name="id2601850"></a><h3>
410
389
<a name="gimp-thumb-ensure-thumb-dir-local"></a>gimp_thumb_ensure_thumb_dir_local ()</h3>
411
<a class="indexterm" name="id2568783"></a><pre class="programlisting">gboolean gimp_thumb_ensure_thumb_dir_local
412
(const gchar *dirname,
413
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size,
414
GError **error);</pre>
390
<a class="indexterm" name="id2601866"></a><pre class="programlisting">gboolean gimp_thumb_ensure_thumb_dir_local (const gchar *dirname,
391
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size,
392
GError **error);</pre>
416
394
This function checks if the directory that is required to store
417
395
local thumbnails for a particular <em class="parameter"><code>size</code></em> exist and attempts to
427
405
<col align="left" valign="top">
431
<span class="term"><em class="parameter"><code>dirname</code></em> :</span></td>
408
<td><span class="term"><em class="parameter"><code>dirname</code></em> :</span></td>
437
<span class="term"><em class="parameter"><code>size</code></em> :</span></td>
413
<td><span class="term"><em class="parameter"><code>size</code></em> :</span></td>
438
414
<td> a GimpThumbSize
443
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
418
<td><span class="term"><em class="parameter"><code>error</code></em> :</span></td>
444
419
<td> return location for possible errors
449
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
423
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
450
424
<td> <code class="literal">TRUE</code> is the directory exists, <code class="literal">FALSE</code> if it could not
431
<p class="since">Since GIMP 2.2
461
435
<div class="refsect2" lang="en">
462
<a name="id2568933"></a><h3>
436
<a name="id2602018"></a><h3>
463
437
<a name="gimp-thumb-get-thumb-dir-local"></a>gimp_thumb_get_thumb_dir_local ()</h3>
464
<a class="indexterm" name="id2568949"></a><pre class="programlisting">gchar* gimp_thumb_get_thumb_dir_local (const gchar *dirname,
465
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);</pre>
438
<a class="indexterm" name="id2602034"></a><pre class="programlisting">gchar* gimp_thumb_get_thumb_dir_local (const gchar *dirname,
439
<a href="libgimpthumb-gimpthumb-enums.html#GimpThumbSize">GimpThumbSize</a> size);</pre>
467
441
Retrieve the name of the local thumbnail folder for a specific
468
442
size. Unlike <a href="libgimpthumb-gimpthumb-utils.html#gimp-thumb-get-thumb-dir"><code class="function">gimp_thumb_get_thumb_dir()</code></a> the returned string is not
474
448
<col align="left" valign="top">
478
<span class="term"><em class="parameter"><code>dirname</code></em> :</span></td>
451
<td><span class="term"><em class="parameter"><code>dirname</code></em> :</span></td>
484
<span class="term"><em class="parameter"><code>size</code></em> :</span></td>
456
<td><span class="term"><em class="parameter"><code>size</code></em> :</span></td>
485
457
<td> a GimpThumbSize
490
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
461
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
491
462
<td> the thumbnail directory in the encoding of the filesystem
468
<p class="since">Since GIMP 2.2
501
472
<div class="refsect2" lang="en">
502
<a name="id2569048"></a><h3>
473
<a name="id2602136"></a><h3>
503
474
<a name="gimp-thumbs-delete-for-uri-local"></a>gimp_thumbs_delete_for_uri_local ()</h3>
504
<a class="indexterm" name="id2569063"></a><pre class="programlisting">void gimp_thumbs_delete_for_uri_local
505
(const gchar *uri);</pre>
475
<a class="indexterm" name="id2602151"></a><pre class="programlisting">void gimp_thumbs_delete_for_uri_local (const gchar *uri);</pre>
507
477
Deletes all thumbnails for the image file specified by <em class="parameter"><code>uri</code></em> from
508
478
the local thumbnail repository.</p>