@girs/gexiv2-0.16 0.16.0-4.0.0-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/gexiv2-0.16-ambient.d.ts +9 -0
- package/gexiv2-0.16-ambient.js +2 -0
- package/gexiv2-0.16-import.d.ts +9 -0
- package/gexiv2-0.16-import.js +3 -0
- package/gexiv2-0.16.d.ts +1407 -0
- package/gexiv2-0.16.js +5 -0
- package/index.d.ts +15 -0
- package/index.js +5 -0
- package/package.json +55 -0
- package/tsconfig.json +25 -0
- package/typedoc.json +7 -0
package/gexiv2-0.16.d.ts
ADDED
|
@@ -0,0 +1,1407 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
|
+
*
|
|
7
|
+
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import '@girs/gjs';
|
|
11
|
+
|
|
12
|
+
// Module dependencies
|
|
13
|
+
import type Gio from '@girs/gio-2.0';
|
|
14
|
+
import type GObject from '@girs/gobject-2.0';
|
|
15
|
+
import type GLib from '@girs/glib-2.0';
|
|
16
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
17
|
+
|
|
18
|
+
export namespace GExiv2 {
|
|
19
|
+
/**
|
|
20
|
+
* GExiv2-0.16
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Options to control the byte order of binary EXIF data exports, in [method`Metadata`.get_exif_data].
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Options to control the byte order of binary EXIF data exports, in [method`Metadata`.get_exif_data].
|
|
29
|
+
*/
|
|
30
|
+
export namespace ByteOrder {
|
|
31
|
+
export const $gtype: GObject.GType<ByteOrder>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
enum ByteOrder {
|
|
35
|
+
/**
|
|
36
|
+
* Use little-endian byte order
|
|
37
|
+
*/
|
|
38
|
+
LITTLE,
|
|
39
|
+
/**
|
|
40
|
+
* Use big-endian byte order
|
|
41
|
+
*/
|
|
42
|
+
BIG,
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Used in
|
|
46
|
+
*
|
|
47
|
+
* GExiv2 log levels
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Used in
|
|
52
|
+
*
|
|
53
|
+
* GExiv2 log levels
|
|
54
|
+
*/
|
|
55
|
+
export namespace LogLevel {
|
|
56
|
+
export const $gtype: GObject.GType<LogLevel>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
enum LogLevel {
|
|
60
|
+
/**
|
|
61
|
+
* Log level for debugging
|
|
62
|
+
*/
|
|
63
|
+
DEBUG,
|
|
64
|
+
/**
|
|
65
|
+
* Log level for informational messages
|
|
66
|
+
*/
|
|
67
|
+
INFO,
|
|
68
|
+
/**
|
|
69
|
+
* Log level for warning messages
|
|
70
|
+
*/
|
|
71
|
+
WARN,
|
|
72
|
+
/**
|
|
73
|
+
* Log level for error messages
|
|
74
|
+
*/
|
|
75
|
+
ERROR,
|
|
76
|
+
/**
|
|
77
|
+
* Suppress all log messages
|
|
78
|
+
*/
|
|
79
|
+
MUTE,
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The orientation of an image is defined as the location of it's x,y origin. More than rotation,
|
|
83
|
+
* orientation allows for every variation of rotation, flips, and mirroring to be described in
|
|
84
|
+
* 3 bits of data.
|
|
85
|
+
*
|
|
86
|
+
* A handy primer to orientation can be found at
|
|
87
|
+
* <http://jpegclub.org/exif_orientation.html>
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The orientation of an image is defined as the location of it's x,y origin. More than rotation,
|
|
92
|
+
* orientation allows for every variation of rotation, flips, and mirroring to be described in
|
|
93
|
+
* 3 bits of data.
|
|
94
|
+
*
|
|
95
|
+
* A handy primer to orientation can be found at
|
|
96
|
+
* <http://jpegclub.org/exif_orientation.html>
|
|
97
|
+
*/
|
|
98
|
+
export namespace Orientation {
|
|
99
|
+
export const $gtype: GObject.GType<Orientation>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
enum Orientation {
|
|
103
|
+
/**
|
|
104
|
+
* The orientation of the image is unknown
|
|
105
|
+
*/
|
|
106
|
+
UNSPECIFIED,
|
|
107
|
+
/**
|
|
108
|
+
* The orientation of the image is without any rotation.
|
|
109
|
+
*/
|
|
110
|
+
NORMAL,
|
|
111
|
+
/**
|
|
112
|
+
* The image is flipped on its horizontal axis
|
|
113
|
+
*/
|
|
114
|
+
HFLIP,
|
|
115
|
+
/**
|
|
116
|
+
* The image is rotated by 180 degrees
|
|
117
|
+
*/
|
|
118
|
+
ROT_180,
|
|
119
|
+
/**
|
|
120
|
+
* The Image is flipped on its vertical axis
|
|
121
|
+
*/
|
|
122
|
+
VFLIP,
|
|
123
|
+
/**
|
|
124
|
+
* The image is rotated by 90 degrees clockwise and flipped on its horizontal axis
|
|
125
|
+
*/
|
|
126
|
+
ROT_90_HFLIP,
|
|
127
|
+
/**
|
|
128
|
+
* The image is rotated by 90 degrees clockwise
|
|
129
|
+
*/
|
|
130
|
+
ROT_90,
|
|
131
|
+
/**
|
|
132
|
+
* The image is rotated by 90 degrees clockwise and flipped on its vertical axis
|
|
133
|
+
*/
|
|
134
|
+
ROT_90_VFLIP,
|
|
135
|
+
/**
|
|
136
|
+
* The image is rotated 270 degrees clockwise
|
|
137
|
+
*/
|
|
138
|
+
ROT_270,
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Used in [method`Metadata`.set_xmp_tag_struct] to determine the array type
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Used in [method`Metadata`.set_xmp_tag_struct] to determine the array type
|
|
146
|
+
*/
|
|
147
|
+
export namespace StructureType {
|
|
148
|
+
export const $gtype: GObject.GType<StructureType>;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
enum StructureType {
|
|
152
|
+
/**
|
|
153
|
+
* Structure is not an array
|
|
154
|
+
*/
|
|
155
|
+
NONE,
|
|
156
|
+
/**
|
|
157
|
+
* A list of alternative values
|
|
158
|
+
*/
|
|
159
|
+
ALT,
|
|
160
|
+
/**
|
|
161
|
+
* An unordered list of values
|
|
162
|
+
*/
|
|
163
|
+
BAG,
|
|
164
|
+
/**
|
|
165
|
+
* An ordered list of values
|
|
166
|
+
*/
|
|
167
|
+
SEQ,
|
|
168
|
+
/**
|
|
169
|
+
* Not supported. For completeness only
|
|
170
|
+
*/
|
|
171
|
+
LANG,
|
|
172
|
+
}
|
|
173
|
+
const MAJOR_VERSION: number;
|
|
174
|
+
const MICRO_VERSION: number;
|
|
175
|
+
const MINOR_VERSION: number;
|
|
176
|
+
/**
|
|
177
|
+
* The gexiv2 library's version number as a formatted decimal XXYYZZ.
|
|
178
|
+
*
|
|
179
|
+
* XX is the major version, YY is the minor version, and ZZ is the micro version
|
|
180
|
+
*
|
|
181
|
+
* For example, version 0.6.1 will be returned as 000601.
|
|
182
|
+
* @returns Integer representing the current version.
|
|
183
|
+
*/
|
|
184
|
+
function get_version(): number;
|
|
185
|
+
/**
|
|
186
|
+
* Initializes GExiv2.
|
|
187
|
+
*
|
|
188
|
+
* GExiv2 requires initialization before its methods are used. In particular, this call must be
|
|
189
|
+
* made in a thread-safe fashion. Best practice is to call from the application's main thread and
|
|
190
|
+
* not to use any Gexiv2 code until it has returned.
|
|
191
|
+
* @returns %TRUE if initialized. If %FALSE, GExiv2 should not be used (unable to initialize properly).
|
|
192
|
+
*/
|
|
193
|
+
function initialize(): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Get the current [enum`GExiv2`.LogLevel].
|
|
196
|
+
*
|
|
197
|
+
* Messages below this level will not be logged.
|
|
198
|
+
* @returns The current level.
|
|
199
|
+
*/
|
|
200
|
+
function log_get_level(): LogLevel;
|
|
201
|
+
/**
|
|
202
|
+
* Set the current [enum`GExiv2`.LogLevel].
|
|
203
|
+
*
|
|
204
|
+
*
|
|
205
|
+
* Messages below this level will not be logged.
|
|
206
|
+
* @param level The [enum@GExiv2.LogLevel] gexiv2 should respect.
|
|
207
|
+
*/
|
|
208
|
+
function log_set_level(level: LogLevel | null): void;
|
|
209
|
+
/**
|
|
210
|
+
* Make GExiv2 use GLib's logging mechanism.
|
|
211
|
+
*
|
|
212
|
+
* When called, gexiv2 will install it's own [callback`GExiv2`.LogHandler] which
|
|
213
|
+
* redirects all Exiv2 and gexiv2 log messages to GLib's logging calls
|
|
214
|
+
* ([func`GLib`.debug], [func`GLib`.message], [func`GLib`.warning], and
|
|
215
|
+
* [func`GLib`.critical] for the respective [enum`GExiv2`.LogLevel] value).
|
|
216
|
+
* [enum`GExiv2`.LogLevel.MUTE] log messages are dropped.
|
|
217
|
+
*
|
|
218
|
+
* One advantage to using this is that GLib's logging control and handlers can be used rather than
|
|
219
|
+
* GExiv2's ad hoc scheme. It also means an application can use GLib logging and have all its
|
|
220
|
+
* messages routed through the same calls.
|
|
221
|
+
*/
|
|
222
|
+
function log_use_glib_logging(): void;
|
|
223
|
+
/**
|
|
224
|
+
* Shutdown GExiv2.
|
|
225
|
+
*
|
|
226
|
+
* Shutdown GExiv2. Should be called in the same thread as gexiv2_initialize().
|
|
227
|
+
*/
|
|
228
|
+
function shutdown(): void;
|
|
229
|
+
interface LogHandler {
|
|
230
|
+
(level: LogLevel, msg: string): void;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Options to control the format of the serialized XMP packet
|
|
234
|
+
* Taken from: exiv2/src/xmp.hpp
|
|
235
|
+
*/
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Options to control the format of the serialized XMP packet
|
|
239
|
+
* Taken from: exiv2/src/xmp.hpp
|
|
240
|
+
*/
|
|
241
|
+
export namespace XmpFormatFlags {
|
|
242
|
+
export const $gtype: GObject.GType<XmpFormatFlags>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
enum XmpFormatFlags {
|
|
246
|
+
/**
|
|
247
|
+
* Omit the XML packet wrapper.
|
|
248
|
+
*/
|
|
249
|
+
OMIT_PACKET_WRAPPER,
|
|
250
|
+
/**
|
|
251
|
+
* Default is a writeable packet.
|
|
252
|
+
*/
|
|
253
|
+
READ_ONLY_PACKET,
|
|
254
|
+
/**
|
|
255
|
+
* Use a compact form of RDF.
|
|
256
|
+
*/
|
|
257
|
+
USE_COMPACT_FORMAT,
|
|
258
|
+
/**
|
|
259
|
+
* Include a padding allowance for a thumbnail image.
|
|
260
|
+
*/
|
|
261
|
+
INCLUDE_THUMBNAIL_PAD,
|
|
262
|
+
/**
|
|
263
|
+
* The padding parameter is the overall packet length.
|
|
264
|
+
*/
|
|
265
|
+
EXACT_PACKET_LENGTH,
|
|
266
|
+
/**
|
|
267
|
+
* Show aliases as XML comments.
|
|
268
|
+
*/
|
|
269
|
+
WRITE_ALIAS_COMMENTS,
|
|
270
|
+
/**
|
|
271
|
+
* Omit all formatting whitespace.
|
|
272
|
+
*/
|
|
273
|
+
OMIT_ALL_FORMATTING,
|
|
274
|
+
}
|
|
275
|
+
namespace Metadata {
|
|
276
|
+
// Signal signatures
|
|
277
|
+
interface SignalSignatures extends GObject.Object.SignalSignatures {}
|
|
278
|
+
|
|
279
|
+
// Constructor properties interface
|
|
280
|
+
|
|
281
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* An object holding all the Exiv2 metadata. Previews, if present, are also available.
|
|
286
|
+
*
|
|
287
|
+
* It is a generic object that provides everything from simple aggregated accessors
|
|
288
|
+
* to common data such as image comments up to fine-grained access to specific tags of a
|
|
289
|
+
* specfic format, be it EXIF, IPTC or XMP.
|
|
290
|
+
*
|
|
291
|
+
* As gexiv2 is only a wrapper around Exiv2, it's better to read its documentation to understand
|
|
292
|
+
* the full scope of what it offers: <http://www.exiv2.org/>
|
|
293
|
+
*
|
|
294
|
+
* In particular, rather than providing a getter/setter method pair for every metadata value
|
|
295
|
+
* available for images (of which there are thousands), Exiv2 uses a dotted addressing scheme.
|
|
296
|
+
* For example, to access a photo's EXIF Orientation field, the caller passes to Exiv2
|
|
297
|
+
* "Exif.Photo.Orientation". These *tags* (in Exiv2 parlance) are key to using Exiv2 (and
|
|
298
|
+
* therefore gexiv2) to its fullest.
|
|
299
|
+
*
|
|
300
|
+
* A full reference for all supported Exiv2 tags can be found at <http://www.exiv2.org/metadata.html>
|
|
301
|
+
*/
|
|
302
|
+
class Metadata extends GObject.Object {
|
|
303
|
+
static $gtype: GObject.GType<Metadata>;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Compile-time signal type information.
|
|
307
|
+
*
|
|
308
|
+
* This instance property is generated only for TypeScript type checking.
|
|
309
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
310
|
+
* @internal
|
|
311
|
+
*/
|
|
312
|
+
$signals: Metadata.SignalSignatures;
|
|
313
|
+
|
|
314
|
+
// Constructors
|
|
315
|
+
|
|
316
|
+
constructor(properties?: Partial<Metadata.ConstructorProps>, ...args: any[]);
|
|
317
|
+
|
|
318
|
+
_init(...args: any[]): void;
|
|
319
|
+
|
|
320
|
+
static ['new'](): Metadata;
|
|
321
|
+
|
|
322
|
+
// Signals
|
|
323
|
+
|
|
324
|
+
connect<K extends keyof Metadata.SignalSignatures>(
|
|
325
|
+
signal: K,
|
|
326
|
+
callback: GObject.SignalCallback<this, Metadata.SignalSignatures[K]>,
|
|
327
|
+
): number;
|
|
328
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
329
|
+
connect_after<K extends keyof Metadata.SignalSignatures>(
|
|
330
|
+
signal: K,
|
|
331
|
+
callback: GObject.SignalCallback<this, Metadata.SignalSignatures[K]>,
|
|
332
|
+
): number;
|
|
333
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
334
|
+
emit<K extends keyof Metadata.SignalSignatures>(
|
|
335
|
+
signal: K,
|
|
336
|
+
...args: GObject.GjsParameters<Metadata.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
337
|
+
): void;
|
|
338
|
+
emit(signal: string, ...args: any[]): void;
|
|
339
|
+
|
|
340
|
+
// Static methods
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Get Exiv2's description for a tag.
|
|
344
|
+
*
|
|
345
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
346
|
+
* @param tag An Exiv2 tag
|
|
347
|
+
*/
|
|
348
|
+
static get_tag_description(tag: string): string | null;
|
|
349
|
+
/**
|
|
350
|
+
* Get Exiv2's label for this tag.
|
|
351
|
+
*
|
|
352
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
353
|
+
* @param tag An Exiv2 tag
|
|
354
|
+
*/
|
|
355
|
+
static get_tag_label(tag: string): string | null;
|
|
356
|
+
/**
|
|
357
|
+
* Get Exiv2's type name of a tag.
|
|
358
|
+
*
|
|
359
|
+
* The names of the various Exiv2 tag types can be found at Exiv2::TypeId,
|
|
360
|
+
* <http://exiv2.org/doc/namespaceExiv2.html#a5153319711f35fe81cbc13f4b852450c>
|
|
361
|
+
*
|
|
362
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
363
|
+
* @param tag An Exiv2 tag
|
|
364
|
+
*/
|
|
365
|
+
static get_tag_type(tag: string): string | null;
|
|
366
|
+
/**
|
|
367
|
+
* Look up the URI for the namespace for `tag`
|
|
368
|
+
* @param tag Full tag name (e.g. "Xmp.dc.subject") or XMP namespace identifier (e.g. "dc")
|
|
369
|
+
*/
|
|
370
|
+
static get_xmp_namespace_for_tag(tag: string): string;
|
|
371
|
+
/**
|
|
372
|
+
* Check whether `tag` is from the EXIF domain of tags.
|
|
373
|
+
*
|
|
374
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
375
|
+
* @param tag An Exiv2 tag
|
|
376
|
+
*/
|
|
377
|
+
static is_exif_tag(tag: string): boolean;
|
|
378
|
+
/**
|
|
379
|
+
* Check whether `tag` is from the IPTC domain of tags.
|
|
380
|
+
*
|
|
381
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
382
|
+
* @param tag An Exiv2 tag
|
|
383
|
+
*/
|
|
384
|
+
static is_iptc_tag(tag: string): boolean;
|
|
385
|
+
/**
|
|
386
|
+
* Check whether `tag` is from the XMP domain of tags.
|
|
387
|
+
*
|
|
388
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
389
|
+
* @param tag An Exiv2 tag
|
|
390
|
+
*/
|
|
391
|
+
static is_xmp_tag(tag: string): boolean;
|
|
392
|
+
/**
|
|
393
|
+
* Register an additional XMP namespace.
|
|
394
|
+
* @param name XMP URI name (should end in /)
|
|
395
|
+
* @param prefix XMP namespace prefix
|
|
396
|
+
*/
|
|
397
|
+
static register_xmp_namespace(name: string, prefix: string): boolean;
|
|
398
|
+
/**
|
|
399
|
+
* Get Exiv2's description for a tag.
|
|
400
|
+
*
|
|
401
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
402
|
+
* @param tag An Exiv2 tag
|
|
403
|
+
*/
|
|
404
|
+
static try_get_tag_description(tag: string): string | null;
|
|
405
|
+
/**
|
|
406
|
+
* Get Exiv2's label for this tag.
|
|
407
|
+
*
|
|
408
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
409
|
+
* @param tag An Exiv2 tag
|
|
410
|
+
*/
|
|
411
|
+
static try_get_tag_label(tag: string): string | null;
|
|
412
|
+
/**
|
|
413
|
+
* Get Exiv2's type name of a tag.
|
|
414
|
+
*
|
|
415
|
+
* The names of the various Exiv2 tag types can be found at Exiv2::TypeId,
|
|
416
|
+
* <http://exiv2.org/doc/namespaceExiv2.html#a5153319711f35fe81cbc13f4b852450c>
|
|
417
|
+
*
|
|
418
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
419
|
+
* @param tag An Exiv2 tag
|
|
420
|
+
*/
|
|
421
|
+
static try_get_tag_type(tag: string): string | null;
|
|
422
|
+
/**
|
|
423
|
+
* Look up the URI for the namespace for `tag`
|
|
424
|
+
* @param tag Full tag name (e.g. "Xmp.dc.subject") or XMP namespace identifier (e.g. "dc")
|
|
425
|
+
*/
|
|
426
|
+
static try_get_xmp_namespace_for_tag(tag: string): string;
|
|
427
|
+
/**
|
|
428
|
+
* Register an additional XMP namespace.
|
|
429
|
+
* @param name XMP URI name (should end in /)
|
|
430
|
+
* @param prefix XMP namespace prefix
|
|
431
|
+
*/
|
|
432
|
+
static try_register_xmp_namespace(name: string, prefix: string): boolean;
|
|
433
|
+
/**
|
|
434
|
+
* Unregister all XMP namespaces that have been previously registered with
|
|
435
|
+
* [func`Metadata`.try_register_xmp_namespace].
|
|
436
|
+
*/
|
|
437
|
+
static try_unregister_all_xmp_namespaces(): void;
|
|
438
|
+
/**
|
|
439
|
+
* Unregister a namespace previously registered with
|
|
440
|
+
* [func`Metadata`.try_register_xmp_namespace].
|
|
441
|
+
* @param name XMP URI name (should end in /)
|
|
442
|
+
*/
|
|
443
|
+
static try_unregister_xmp_namespace(name: string): boolean;
|
|
444
|
+
/**
|
|
445
|
+
* Unregister all XMP namespaces that have been previously registered with
|
|
446
|
+
* [func`Metadata`.try_register_xmp_namespace].
|
|
447
|
+
*/
|
|
448
|
+
static unregister_all_xmp_namespaces(): void;
|
|
449
|
+
/**
|
|
450
|
+
* Unregister a namespace previously registered with
|
|
451
|
+
* [func`Metadata`.try_register_xmp_namespace].
|
|
452
|
+
* @param name XMP URI name (should end in /)
|
|
453
|
+
*/
|
|
454
|
+
static unregister_xmp_namespace(name: string): boolean;
|
|
455
|
+
|
|
456
|
+
// Methods
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Saves the metadata to the stream by reading the stream into memory, copying this object's
|
|
460
|
+
* metadata into the image, then writing the image as a stream back out.
|
|
461
|
+
*
|
|
462
|
+
* if `bytes` is %NULL, a copy of the internal image with updated metadata will be returned.
|
|
463
|
+
* @param bytes An image buffer to update the metadata on, nor %NULL
|
|
464
|
+
* @returns A newly allocated GBytes object containing the image with new metadata
|
|
465
|
+
*/
|
|
466
|
+
as_bytes(bytes?: GLib.Bytes | null): GLib.Bytes;
|
|
467
|
+
/**
|
|
468
|
+
* Removes all tags for all domains (EXIF, IPTC, and XMP).
|
|
469
|
+
*/
|
|
470
|
+
clear(): void;
|
|
471
|
+
/**
|
|
472
|
+
* This is a composite clear method that will clear a number of fields. See
|
|
473
|
+
* [method`Metadata`.get_comment] for more information.
|
|
474
|
+
*/
|
|
475
|
+
clear_comment(): void;
|
|
476
|
+
/**
|
|
477
|
+
* Clears all EXIF metadata from the loaded image.
|
|
478
|
+
*/
|
|
479
|
+
clear_exif(): void;
|
|
480
|
+
/**
|
|
481
|
+
* Clears all IPTC metadata from the loaded image.
|
|
482
|
+
*/
|
|
483
|
+
clear_iptc(): void;
|
|
484
|
+
/**
|
|
485
|
+
* Removes the Exiv2 tag from the metadata object.
|
|
486
|
+
*
|
|
487
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
488
|
+
* @param tag Exiv2 tag
|
|
489
|
+
* @returns %TRUE if the tag was present.
|
|
490
|
+
*/
|
|
491
|
+
clear_tag(tag: string): boolean;
|
|
492
|
+
/**
|
|
493
|
+
* Clears all XMP metadata from the loaded image.
|
|
494
|
+
*/
|
|
495
|
+
clear_xmp(): void;
|
|
496
|
+
/**
|
|
497
|
+
* Removes all GPS metadata from the loaded image
|
|
498
|
+
*/
|
|
499
|
+
delete_gps_info(): void;
|
|
500
|
+
/**
|
|
501
|
+
* Removes the EXIF thumbnail from the loaded image.
|
|
502
|
+
*/
|
|
503
|
+
erase_exif_thumbnail(): void;
|
|
504
|
+
/**
|
|
505
|
+
* Load only an EXIF buffer, typically stored in a JPEG's APP1 segment.
|
|
506
|
+
* @param data A buffer containing the data to be read
|
|
507
|
+
* @returns Boolean success indicator.
|
|
508
|
+
*/
|
|
509
|
+
from_app1_segment(data: Uint8Array | string): boolean;
|
|
510
|
+
/**
|
|
511
|
+
* Read metadata from a [class`Gio`.InputStream]. This function is not very
|
|
512
|
+
* efficient in places since it needs to copy memory to fullfil underlying
|
|
513
|
+
* requirements by exiv2, which expects everything to be memory-mappable.
|
|
514
|
+
* @param stream
|
|
515
|
+
*/
|
|
516
|
+
from_stream(stream: Gio.InputStream): boolean;
|
|
517
|
+
/**
|
|
518
|
+
* Encode the XMP packet as a %NULL-terminated string.
|
|
519
|
+
* @param xmp_format_flags One of #GExiv2XmpFormatFlags
|
|
520
|
+
* @param padding The padding before the closing `<?xpacket>` tag
|
|
521
|
+
* @returns Encode the XMP packet and return as a %NULL-terminated string.
|
|
522
|
+
*/
|
|
523
|
+
generate_xmp_packet(xmp_format_flags: XmpFormatFlags | null, padding: number): string | null;
|
|
524
|
+
/**
|
|
525
|
+
* A composite accessor that uses the first available metadata field from a list of well-known
|
|
526
|
+
* locations to find the photo's comment (or description).
|
|
527
|
+
*
|
|
528
|
+
* MWG guidelines refer to these as *Description*: a textual description of a resource's content.
|
|
529
|
+
*
|
|
530
|
+
* These fields are:
|
|
531
|
+
*
|
|
532
|
+
* - Exif.Image.ImageDescription (MWG Guidelines)
|
|
533
|
+
* - Exif.Photo.UserComment
|
|
534
|
+
* - Exif.Image.XPComment
|
|
535
|
+
* - Iptc.Application2.Caption (MWG Guidelines)
|
|
536
|
+
* - Xmp.dc.description (MWG Guidelines)
|
|
537
|
+
* - Xmp.acdsee.notes (Commonly requested, read only)
|
|
538
|
+
*
|
|
539
|
+
* <note>Note that in the EXIF specification Exif.Image.ImageDescription is
|
|
540
|
+
* described as "the title of the image". Also, it does not support
|
|
541
|
+
* two-byte character codes for encoding. However, it's still used here for legacy reasons.
|
|
542
|
+
* </note>
|
|
543
|
+
*
|
|
544
|
+
* For fine-grained control, it's recommended to use Exiv2 tags directly rather than this method,
|
|
545
|
+
* which is more useful for quick or casual use.
|
|
546
|
+
* @returns The photo's comment field.
|
|
547
|
+
*/
|
|
548
|
+
get_comment(): string | null;
|
|
549
|
+
/**
|
|
550
|
+
* Returns a binary blob of the contained EXIF data, if the image contains any.
|
|
551
|
+
* @param byte_order Whether to export the data in little or big endian format
|
|
552
|
+
* @returns The content of the EXIF data or %NULL on error
|
|
553
|
+
*/
|
|
554
|
+
get_exif_data(byte_order: ByteOrder | null): GLib.Bytes | null;
|
|
555
|
+
/**
|
|
556
|
+
* Fetch EXIF `tag` represented by a fraction. `nom` will contain the numerator,
|
|
557
|
+
* `den` the denominator of the fraction on successful return.
|
|
558
|
+
* @param tag The tag you want the rational value for
|
|
559
|
+
* @returns Boolean success value
|
|
560
|
+
*/
|
|
561
|
+
get_exif_tag_rational(tag: string): [boolean, number, number];
|
|
562
|
+
/**
|
|
563
|
+
* Query `self` for a list of available EXIF tags
|
|
564
|
+
* @returns A unique list of the available EXIF tags in the loaded image
|
|
565
|
+
*/
|
|
566
|
+
get_exif_tags(): string[];
|
|
567
|
+
/**
|
|
568
|
+
* Get the thumbnail stored in the EXIF data of `self`
|
|
569
|
+
* @returns Boolean success value
|
|
570
|
+
*/
|
|
571
|
+
get_exif_thumbnail(): [boolean, Uint8Array];
|
|
572
|
+
/**
|
|
573
|
+
* Returns the exposure time in seconds (shutter speed, *not* date-time of exposure) as a
|
|
574
|
+
* rational. See <https://en.wikipedia.org/wiki/Shutter_speed> for more information.
|
|
575
|
+
* @returns Boolean success value
|
|
576
|
+
*/
|
|
577
|
+
get_exposure_time(): [boolean, number, number];
|
|
578
|
+
/**
|
|
579
|
+
* See <https://en.wikipedia.org/wiki/F-number> for more information.
|
|
580
|
+
* If Exif.Photo.FNumber does not exist, it will fall back to calculating the FNumber from
|
|
581
|
+
* Exif.Photo.ApertureValue (if available)
|
|
582
|
+
* @returns The exposure Fnumber as a gdouble, or -1.0 if tag is not present or invalid.
|
|
583
|
+
*/
|
|
584
|
+
get_fnumber(): number;
|
|
585
|
+
/**
|
|
586
|
+
* See <https://en.wikipedia.org/wiki/Flange_focal_distance> for more information.
|
|
587
|
+
* @returns The focal length as a gdouble, or -1.0 if tag is not present or invalid.
|
|
588
|
+
*/
|
|
589
|
+
get_focal_length(): number;
|
|
590
|
+
/**
|
|
591
|
+
* Convenience function to query the altitude stored in the GPS tags of the
|
|
592
|
+
* image
|
|
593
|
+
* @returns The altitude value, or -inf on error, or nan if no altitude value.
|
|
594
|
+
*/
|
|
595
|
+
get_gps_altitude(): number;
|
|
596
|
+
/**
|
|
597
|
+
* Convenience function to query all available GPS information at once. See the
|
|
598
|
+
* [method`GExiv2`.Metadata.get_gps_longitude], [method`GExiv2`.Metadata.get_gps_latitude]
|
|
599
|
+
* and [method`GExiv2`.Metadata.get_gps_altitude] for possible values of the out
|
|
600
|
+
* parameters.
|
|
601
|
+
* @returns Boolean success value. Indicates if any of the queries failed.
|
|
602
|
+
*/
|
|
603
|
+
get_gps_info(): [boolean, number, number, number];
|
|
604
|
+
/**
|
|
605
|
+
* Query the latitude stored in the GPS tags of `self`
|
|
606
|
+
* @returns The latitude or -inf on error, nan if no altitude value is found.
|
|
607
|
+
*/
|
|
608
|
+
get_gps_latitude(): number;
|
|
609
|
+
/**
|
|
610
|
+
* Query the longitude stored in the GPS tags of `self`
|
|
611
|
+
* @returns The longitude value, or -inf on error, or nan if no altitude value.
|
|
612
|
+
*/
|
|
613
|
+
get_gps_longitude(): number;
|
|
614
|
+
/**
|
|
615
|
+
* Query `self` for a list of available IPTC tags
|
|
616
|
+
* @returns A unique list of the available IPTC tags
|
|
617
|
+
*/
|
|
618
|
+
get_iptc_tags(): string[];
|
|
619
|
+
/**
|
|
620
|
+
* See <https://en.wikipedia.org/wiki/Iso_speed> for more information.
|
|
621
|
+
* @returns The ISO speed rating as a gint, or 0 if tag is not present or invalid.
|
|
622
|
+
*/
|
|
623
|
+
get_iso_speed(): number;
|
|
624
|
+
/**
|
|
625
|
+
* Composite accessor to query the pixel with stored in the metadata. This
|
|
626
|
+
* might differ from the height of image that is available through
|
|
627
|
+
* [method`Metadata`.get_pixel_height]
|
|
628
|
+
* @returns Height of images in pixels as stored in the metadata
|
|
629
|
+
*/
|
|
630
|
+
get_metadata_pixel_height(): number;
|
|
631
|
+
/**
|
|
632
|
+
* Composite accessor to query the pixel with stored in the metadata. This
|
|
633
|
+
* might differ from the width of image that is available through
|
|
634
|
+
* [method`Metadata`.get_pixel_width]
|
|
635
|
+
* @returns Width of images in pixels as stored in the metadata
|
|
636
|
+
*/
|
|
637
|
+
get_metadata_pixel_width(): number;
|
|
638
|
+
/**
|
|
639
|
+
* Query mime type of currently loaded image.
|
|
640
|
+
* @returns The MIME type of the loaded image, %NULL if not loaded or unknown.
|
|
641
|
+
*/
|
|
642
|
+
get_mime_type(): string;
|
|
643
|
+
/**
|
|
644
|
+
* The EXIF Orientation field
|
|
645
|
+
* @returns A [enum@GExiv2.Orientation] value representing the EXIF orientation value.
|
|
646
|
+
*/
|
|
647
|
+
get_orientation(): Orientation;
|
|
648
|
+
/**
|
|
649
|
+
* Get the *actual* unoriented display height in pixels of the loaded image. This may
|
|
650
|
+
* be different than the height reported by various metadata tags, i.e. `Exif.Photo.PixelYDimension`.
|
|
651
|
+
* @returns Pixel height of current image
|
|
652
|
+
*/
|
|
653
|
+
get_pixel_height(): number;
|
|
654
|
+
/**
|
|
655
|
+
* Get the *actual* unoriented display width in pixels of the loaded
|
|
656
|
+
* image. May be different than the width reported by various metadata tags,
|
|
657
|
+
* i.e. `Exif.Photo.PixelXDimension`.
|
|
658
|
+
* @returns Pixel width of current image
|
|
659
|
+
*/
|
|
660
|
+
get_pixel_width(): number;
|
|
661
|
+
/**
|
|
662
|
+
* Get a preview image from the metadata.
|
|
663
|
+
* @param props A #GExiv2PreviewProperties instance
|
|
664
|
+
* @returns A #GExiv2PreviewImage instance for the particular #GExiv2PreviewProperties.
|
|
665
|
+
*/
|
|
666
|
+
get_preview_image(props: PreviewProperties): PreviewImage;
|
|
667
|
+
/**
|
|
668
|
+
* An image may have stored one or more previews, often of different qualities, sometimes of
|
|
669
|
+
* different image formats than the containing image. This call returns the properties of all
|
|
670
|
+
* previews Exiv2 finds within the loaded image. Use [method`Metadata`.get_preview_image] to
|
|
671
|
+
* load a particular preview into memory.
|
|
672
|
+
* @returns An array of #GExiv2PreviewProperties instances, one for each preview present in the loaded image.
|
|
673
|
+
*/
|
|
674
|
+
get_preview_properties(): PreviewProperties[] | null;
|
|
675
|
+
/**
|
|
676
|
+
* Query whether the currently loaded image supports writing of EXIF metadata.
|
|
677
|
+
* @returns %TRUE if the loaded image type supports writing EXIF metadata.
|
|
678
|
+
*/
|
|
679
|
+
get_supports_exif(): boolean;
|
|
680
|
+
/**
|
|
681
|
+
* Query whether the currently loaded image supports writing of IPTC metadata.
|
|
682
|
+
* @returns %TRUE if the loaded image type supports writing IPTC metadata.
|
|
683
|
+
*/
|
|
684
|
+
get_supports_iptc(): boolean;
|
|
685
|
+
/**
|
|
686
|
+
* Query whether the currently loaded image supports writing of XMP metadata.
|
|
687
|
+
* @returns %TRUE if the loaded image type supports writing XMP metadata.
|
|
688
|
+
*/
|
|
689
|
+
get_supports_xmp(): boolean;
|
|
690
|
+
/**
|
|
691
|
+
* An interpreted string is one fit for user display. It may display units or use formatting
|
|
692
|
+
* appropriate to the type of data the tag holds.
|
|
693
|
+
*
|
|
694
|
+
* Tags that support multiple values are returned as a single string, with elements separated by ", ".
|
|
695
|
+
*
|
|
696
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
697
|
+
* @param tag Exiv2 tag name
|
|
698
|
+
* @returns The tag's interpreted value as a string
|
|
699
|
+
*/
|
|
700
|
+
get_tag_interpreted_string(tag: string): string | null;
|
|
701
|
+
/**
|
|
702
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
703
|
+
* @param tag Exiv2 tag name
|
|
704
|
+
* @returns The tag's value as a glong
|
|
705
|
+
*/
|
|
706
|
+
get_tag_long(tag: string): number;
|
|
707
|
+
/**
|
|
708
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
709
|
+
*
|
|
710
|
+
* In case of error, a GLib warning will be logged. Use instead
|
|
711
|
+
* [method`Metadata`.try_get_tag_multiple] if you want to avoid this and
|
|
712
|
+
* control if and how the error is outputted.
|
|
713
|
+
* @param tag Exiv2 tag name
|
|
714
|
+
* @returns The multiple string values of the tag. Returns %NULL if parameters are %NULL or @tag does not begin with recognised type of metadata ("Exif.", "Xmp." or "Iptc."). For a well formed @tag, returns array[0] = %NULL if @tag is undefined or is not set in the current metadata.
|
|
715
|
+
*/
|
|
716
|
+
get_tag_multiple(tag: string): string[] | null;
|
|
717
|
+
/**
|
|
718
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
719
|
+
*
|
|
720
|
+
* Tags that support multiple values may bereturned as a single byte array, with records separated
|
|
721
|
+
* by 4x INFORMATION SEPARATOR FOUR (ASCII 0x1c)
|
|
722
|
+
* @param tag Exiv2 tag name
|
|
723
|
+
* @returns The tag's raw value as a byte array
|
|
724
|
+
*/
|
|
725
|
+
get_tag_raw(tag: string): GLib.Bytes | null;
|
|
726
|
+
/**
|
|
727
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
728
|
+
*
|
|
729
|
+
* Tags that support multiple values are returned as a single string, with elements separated by ", ".
|
|
730
|
+
*
|
|
731
|
+
* In case of error, a GLib warning will be logged. Use instead
|
|
732
|
+
* [method`Metadata`.try_get_tag_string] if you want to avoid this and
|
|
733
|
+
* control if and how the error is outputted.
|
|
734
|
+
* @param tag Exiv2 tag name
|
|
735
|
+
* @returns The tag's value as a string
|
|
736
|
+
*/
|
|
737
|
+
get_tag_string(tag: string): string | null;
|
|
738
|
+
/**
|
|
739
|
+
* Get the currently encoded XMP packet (after having called [method`GExiv2`.Metadata.try_get_xmp_packet])
|
|
740
|
+
* @returns The currently-encoded XMP packet (see [method@Metadata.generate_xmp_packet]).
|
|
741
|
+
*/
|
|
742
|
+
get_xmp_packet(): string | null;
|
|
743
|
+
/**
|
|
744
|
+
* Get the XMP data from the image.
|
|
745
|
+
*
|
|
746
|
+
* This could contain multiple XML snippets.
|
|
747
|
+
* @returns A unique list of the available XMP tags
|
|
748
|
+
*/
|
|
749
|
+
get_xmp_tags(): string[];
|
|
750
|
+
/**
|
|
751
|
+
* Whether the metadata contains EXIF data.
|
|
752
|
+
* @returns TRUE if EXIF metadata is present in the loaded image
|
|
753
|
+
*/
|
|
754
|
+
has_exif(): boolean;
|
|
755
|
+
/**
|
|
756
|
+
* Whether the image has IPTC metadata
|
|
757
|
+
* @returns TRUE if IPTC metadata is present in the loaded image
|
|
758
|
+
*/
|
|
759
|
+
has_iptc(): boolean;
|
|
760
|
+
/**
|
|
761
|
+
* Check for presence of a tag.
|
|
762
|
+
*
|
|
763
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
764
|
+
* @param tag Exiv2 tag
|
|
765
|
+
* @returns %TRUE if the tag is present.
|
|
766
|
+
*/
|
|
767
|
+
has_tag(tag: string): boolean;
|
|
768
|
+
/**
|
|
769
|
+
* Whether the metadata contains XMP data.
|
|
770
|
+
* @returns TRUE if XMP metadata is present in the loaded image
|
|
771
|
+
*/
|
|
772
|
+
has_xmp(): boolean;
|
|
773
|
+
/**
|
|
774
|
+
* Populate metadata from a memory buffer.
|
|
775
|
+
*
|
|
776
|
+
* The buffer must be an image format supported by Exiv2. If called multiple times,
|
|
777
|
+
* current metadata will be replaced by the content of the last file opened.
|
|
778
|
+
*
|
|
779
|
+
* When called on an already filled meta-data object (i.e. one that has already
|
|
780
|
+
* been filled by a previous call of [method`GExiv2`.Metadata.open_path]) and the
|
|
781
|
+
* opening of the new path fails, the object will not revert to its previous
|
|
782
|
+
* state but be in a similar state after calling [method`GExiv2`.Metadata.new].
|
|
783
|
+
* @param data A buffer containing the data to be read
|
|
784
|
+
* @returns Boolean success indicator
|
|
785
|
+
*/
|
|
786
|
+
open_buf(data: Uint8Array | string): boolean;
|
|
787
|
+
/**
|
|
788
|
+
* Populate metadata from `path`.
|
|
789
|
+
*
|
|
790
|
+
* The file must be an image format supported by Exiv2. If called multiple times,
|
|
791
|
+
* current metadata will be replaced by the content of the last file opened.
|
|
792
|
+
* @param path Path to the file you want to open
|
|
793
|
+
* @returns Boolean success indicator
|
|
794
|
+
*/
|
|
795
|
+
open_path(path: string): boolean;
|
|
796
|
+
/**
|
|
797
|
+
* Saves the metadata to the specified using an XMP sidecar file.
|
|
798
|
+
* @param path Path to the file you want to save to.
|
|
799
|
+
* @returns Boolean success indicator.
|
|
800
|
+
*/
|
|
801
|
+
save_external(path: string): boolean;
|
|
802
|
+
/**
|
|
803
|
+
* Saves the metadata to the specified file by reading the file into memory, copying this object's
|
|
804
|
+
* metadata into the image, then writing the image back out.
|
|
805
|
+
* @param path Path to the file you want to save to.
|
|
806
|
+
* @returns Boolean success indicator.
|
|
807
|
+
*/
|
|
808
|
+
save_file(path: string): boolean;
|
|
809
|
+
/**
|
|
810
|
+
* This is a composite setter that will set a number of fields to the supplied value. See
|
|
811
|
+
* [method`Metadata`.get_comment] for more information.
|
|
812
|
+
* @param comment Comment string to set. Must not be %NULL
|
|
813
|
+
*/
|
|
814
|
+
set_comment(comment: string): void;
|
|
815
|
+
/**
|
|
816
|
+
* Set EXIF `tag` represented by a fraction, with `nom` being the numerator,
|
|
817
|
+
* `den` the denominator of the fraction.
|
|
818
|
+
* @param tag The Exiv2 tag
|
|
819
|
+
* @param nom Rational numerator
|
|
820
|
+
* @param den Rational denominator
|
|
821
|
+
* @returns Boolean success value
|
|
822
|
+
*/
|
|
823
|
+
set_exif_tag_rational(tag: string, nom: number, den: number): boolean;
|
|
824
|
+
/**
|
|
825
|
+
* Sets or replaces the EXIF thumbnail with the data in `buffer`.
|
|
826
|
+
* @param buffer A buffer containing thumbnail data
|
|
827
|
+
*/
|
|
828
|
+
set_exif_thumbnail_from_buffer(buffer: Uint8Array | string): void;
|
|
829
|
+
/**
|
|
830
|
+
* Sets or replaces the EXIF thumbnail with the image in the file
|
|
831
|
+
* @param path Path of image file
|
|
832
|
+
* @returns Boolean success value
|
|
833
|
+
*/
|
|
834
|
+
set_exif_thumbnail_from_file(path: string): boolean;
|
|
835
|
+
/**
|
|
836
|
+
* Convenience function to create a new set of simple GPS data. Warning: Will remove any other
|
|
837
|
+
* GPS information that is currently set. See [method`Metadata`.update_gps_info] for
|
|
838
|
+
* just modifying the GPS data.
|
|
839
|
+
* @param longitude Longitude value to set or replace current value
|
|
840
|
+
* @param latitude Latitude value to set or replace current value
|
|
841
|
+
* @param altitude Altitude value to set or replace current value
|
|
842
|
+
* @returns Boolean success value.
|
|
843
|
+
*/
|
|
844
|
+
set_gps_info(longitude: number, latitude: number, altitude: number): boolean;
|
|
845
|
+
/**
|
|
846
|
+
* Update the image's metadata with `height`
|
|
847
|
+
* @param height The width of the image as it should be put into the metadata.
|
|
848
|
+
*/
|
|
849
|
+
set_metadata_pixel_height(height: number): void;
|
|
850
|
+
/**
|
|
851
|
+
* Composite setter to update the image's metadata with `width`
|
|
852
|
+
* @param width The width of the image as it should be put into the metadata
|
|
853
|
+
*/
|
|
854
|
+
set_metadata_pixel_width(width: number): void;
|
|
855
|
+
/**
|
|
856
|
+
* The orientation must be valid and cannot be [enum`GExiv2`.Orientation.UNSPECIFIED].
|
|
857
|
+
* @param orientation The new [enum@GExiv2.Orientation] for the image.
|
|
858
|
+
*/
|
|
859
|
+
set_orientation(orientation: Orientation | null): void;
|
|
860
|
+
/**
|
|
861
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
862
|
+
* @param tag Exiv2 tag name
|
|
863
|
+
* @param value The value to set or replace the existing value
|
|
864
|
+
* @returns TRUE on success
|
|
865
|
+
*/
|
|
866
|
+
set_tag_long(tag: string, value: number): boolean;
|
|
867
|
+
/**
|
|
868
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
869
|
+
*
|
|
870
|
+
* All previous `tag` values are erased. For multiple value tags, each of the non %NULL
|
|
871
|
+
* entries in `values` is stored. For single value tags, only the last non %NULL value
|
|
872
|
+
* is assigned.
|
|
873
|
+
* @param tag Exiv2 tag name
|
|
874
|
+
* @param values An array of values to set or replace the existing value(s)
|
|
875
|
+
* @returns Boolean success value
|
|
876
|
+
*/
|
|
877
|
+
set_tag_multiple(tag: string, values: string[]): boolean;
|
|
878
|
+
/**
|
|
879
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
880
|
+
*
|
|
881
|
+
* If a tag supports multiple values, then `value` is added to any existing values. For single
|
|
882
|
+
* value tags, `value` replaces the value.
|
|
883
|
+
*
|
|
884
|
+
* In case of error, a GLib warning will be logged. Use instead
|
|
885
|
+
* [method`Metadata`.try_set_tag_string] if you want to avoid this and
|
|
886
|
+
* control if and how the error is outputted.
|
|
887
|
+
* @param tag Exiv2 tag name
|
|
888
|
+
* @param value The value to set or replace the existing value
|
|
889
|
+
* @returns TRUE on success
|
|
890
|
+
*/
|
|
891
|
+
set_tag_string(tag: string, value: string): boolean;
|
|
892
|
+
/**
|
|
893
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
894
|
+
* @param tag Exiv2 tag name
|
|
895
|
+
* @param type The GExiv2StructureType specifying the type of structure
|
|
896
|
+
* @returns TRUE on success
|
|
897
|
+
*/
|
|
898
|
+
set_xmp_tag_struct(tag: string, type: StructureType | null): boolean;
|
|
899
|
+
/**
|
|
900
|
+
* Check whether a tag supports multiple values.
|
|
901
|
+
*
|
|
902
|
+
* Multiple value tags are Xmp tags of type "XmpAlt", "XmpBag", "XmpSeq" or "LangAlt", or Iptc
|
|
903
|
+
* tags marked as Repeatable (which can be of any Iptc type). There are no multiple value Exif
|
|
904
|
+
* tags.
|
|
905
|
+
*
|
|
906
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
907
|
+
* @param tag An Exiv2 tag
|
|
908
|
+
* @returns Whether @tag is capable of storing multiple values or not. If @tag is undefined (i.e. not built-in and not added to @self), then @error is set and %FALSE is returned.
|
|
909
|
+
*/
|
|
910
|
+
tag_supports_multiple_values(tag: string): boolean;
|
|
911
|
+
/**
|
|
912
|
+
* Removes the Exiv2 tag from the metadata object.
|
|
913
|
+
*
|
|
914
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
915
|
+
* @param tag Exiv2 tag
|
|
916
|
+
* @returns TRUE if the tag was present.
|
|
917
|
+
*/
|
|
918
|
+
try_clear_tag(tag: string): boolean;
|
|
919
|
+
/**
|
|
920
|
+
* Removes all GPS metadata from the loaded image
|
|
921
|
+
*/
|
|
922
|
+
try_delete_gps_info(): void;
|
|
923
|
+
/**
|
|
924
|
+
* Removes the EXIF thumbnail from the loaded image.
|
|
925
|
+
*/
|
|
926
|
+
try_erase_exif_thumbnail(): void;
|
|
927
|
+
/**
|
|
928
|
+
* Encode the XMP packet as a %NULL-terminated string.
|
|
929
|
+
* @param xmp_format_flags One of #GExiv2XmpFormatFlags
|
|
930
|
+
* @param padding The padding before the closing `<?xpacket>` tag
|
|
931
|
+
* @returns Encode the XMP packet and return as a %NULL-terminated string.
|
|
932
|
+
*/
|
|
933
|
+
try_generate_xmp_packet(xmp_format_flags: XmpFormatFlags | null, padding: number): string | null;
|
|
934
|
+
/**
|
|
935
|
+
* A composite accessor that uses the first available metadata field from a list of well-known
|
|
936
|
+
* locations to find the photo's comment (or description).
|
|
937
|
+
*
|
|
938
|
+
* MWG guidelines refer to these as *Description*: a textual description of a resource's content.
|
|
939
|
+
*
|
|
940
|
+
* These fields are:
|
|
941
|
+
*
|
|
942
|
+
* - Exif.Image.ImageDescription (MWG Guidelines)
|
|
943
|
+
* - Exif.Photo.UserComment
|
|
944
|
+
* - Exif.Image.XPComment
|
|
945
|
+
* - Iptc.Application2.Caption (MWG Guidelines)
|
|
946
|
+
* - Xmp.dc.description (MWG Guidelines)
|
|
947
|
+
* - Xmp.acdsee.notes (Commonly requested, read only)
|
|
948
|
+
*
|
|
949
|
+
* <note>Note that in the EXIF specification Exif.Image.ImageDescription is
|
|
950
|
+
* described as "the title of the image". Also, it does not support
|
|
951
|
+
* two-byte character codes for encoding. However, it's still used here for legacy reasons.
|
|
952
|
+
* </note>
|
|
953
|
+
*
|
|
954
|
+
* For fine-grained control, it's recommended to use Exiv2 tags directly rather than this method,
|
|
955
|
+
* which is more useful for quick or casual use.
|
|
956
|
+
* @returns The photo's comment field.
|
|
957
|
+
*/
|
|
958
|
+
try_get_comment(): string | null;
|
|
959
|
+
/**
|
|
960
|
+
* Fetch EXIF `tag` represented by a fraction. `nom` will contain the numerator,
|
|
961
|
+
* `den` the denominator of the fraction on successful return.
|
|
962
|
+
* @param tag The tag you want the rational value for
|
|
963
|
+
* @returns Boolean success value
|
|
964
|
+
*/
|
|
965
|
+
try_get_exif_tag_rational(tag: string): [boolean, number, number];
|
|
966
|
+
/**
|
|
967
|
+
* Returns the exposure time in seconds (shutter speed, *not* date-time of exposure) as a
|
|
968
|
+
* rational. See <https://en.wikipedia.org/wiki/Shutter_speed> for more information.
|
|
969
|
+
* @returns Boolean success value
|
|
970
|
+
*/
|
|
971
|
+
try_get_exposure_time(): [boolean, number, number];
|
|
972
|
+
/**
|
|
973
|
+
* See <https://en.wikipedia.org/wiki/F-number> for more information.
|
|
974
|
+
* If Exif.Photo.FNumber does not exist, it will fall back to calculating the FNumber from
|
|
975
|
+
* Exif.Photo.ApertureValue (if available);
|
|
976
|
+
* @returns The exposure Fnumber as a gdouble, or -1.0 if tag is not present or invalid.
|
|
977
|
+
*/
|
|
978
|
+
try_get_fnumber(): number;
|
|
979
|
+
/**
|
|
980
|
+
* See <https://en.wikipedia.org/wiki/Flange_focal_distance> for more information.
|
|
981
|
+
* @returns The focal length as a gdouble, or -1.0 if tag is not present or invalid.
|
|
982
|
+
*/
|
|
983
|
+
try_get_focal_length(): number;
|
|
984
|
+
/**
|
|
985
|
+
* Convenience function to query the altitude stored in the GPS tags of the
|
|
986
|
+
* image
|
|
987
|
+
* @returns Boolean success value
|
|
988
|
+
*/
|
|
989
|
+
try_get_gps_altitude(): [boolean, number];
|
|
990
|
+
/**
|
|
991
|
+
* Convenience function to query all available GPS information at once.
|
|
992
|
+
* @returns Boolean success value.
|
|
993
|
+
*/
|
|
994
|
+
try_get_gps_info(): [boolean, number, number, number];
|
|
995
|
+
/**
|
|
996
|
+
* Query the latitude stored in the GPS tags of `self`
|
|
997
|
+
* @returns Boolean success value
|
|
998
|
+
*/
|
|
999
|
+
try_get_gps_latitude(): [boolean, number];
|
|
1000
|
+
/**
|
|
1001
|
+
* Query the longitude stored in the GPS tags of `self`
|
|
1002
|
+
* @returns Boolean success value
|
|
1003
|
+
*/
|
|
1004
|
+
try_get_gps_longitude(): [boolean, number];
|
|
1005
|
+
/**
|
|
1006
|
+
* See <https://en.wikipedia.org/wiki/Iso_speed> for more information.
|
|
1007
|
+
* @returns The ISO speed rating as a gint, or 0 if tag is not present or invalid.
|
|
1008
|
+
*/
|
|
1009
|
+
try_get_iso_speed(): number;
|
|
1010
|
+
/**
|
|
1011
|
+
* Composite accessor to query the pixel with stored in the metadata. This
|
|
1012
|
+
* might differ from the height of image that is available through
|
|
1013
|
+
* [method`Metadata`.get_pixel_height]
|
|
1014
|
+
* @returns Height of images in pixels as stored in the metadata
|
|
1015
|
+
*/
|
|
1016
|
+
try_get_metadata_pixel_height(): number;
|
|
1017
|
+
/**
|
|
1018
|
+
* Composite accessor to query the pixel with stored in the metadata. This
|
|
1019
|
+
* might differ from the width of image that is available through
|
|
1020
|
+
* [method`Metadata`.get_pixel_width]
|
|
1021
|
+
* @returns Width of images in pixels as stored in the metadata
|
|
1022
|
+
*/
|
|
1023
|
+
try_get_metadata_pixel_width(): number;
|
|
1024
|
+
/**
|
|
1025
|
+
* The EXIF Orientation field
|
|
1026
|
+
* @returns A [enum@GExiv2.Orientation] value representing the EXIF orientation value.
|
|
1027
|
+
*/
|
|
1028
|
+
try_get_orientation(): Orientation;
|
|
1029
|
+
/**
|
|
1030
|
+
* Get a preview image from the metadata.
|
|
1031
|
+
* @param props A #GExiv2PreviewProperties instance
|
|
1032
|
+
* @returns A #GExiv2PreviewImage instance for the particular #GExiv2PreviewProperties.
|
|
1033
|
+
*/
|
|
1034
|
+
try_get_preview_image(props: PreviewProperties): PreviewImage;
|
|
1035
|
+
/**
|
|
1036
|
+
* An interpreted string is one fit for user display. It may display units or use formatting
|
|
1037
|
+
* appropriate to the type of data the tag holds.
|
|
1038
|
+
*
|
|
1039
|
+
* Tags that support multiple values are returned as a single string, with elements separated by ", ".
|
|
1040
|
+
*
|
|
1041
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1042
|
+
* @param tag Exiv2 tag name
|
|
1043
|
+
* @returns The tag's interpreted value as a string
|
|
1044
|
+
*/
|
|
1045
|
+
try_get_tag_interpreted_string(tag: string): string | null;
|
|
1046
|
+
/**
|
|
1047
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1048
|
+
* @param tag Exiv2 tag name
|
|
1049
|
+
* @returns The tag's value as a glong
|
|
1050
|
+
*/
|
|
1051
|
+
try_get_tag_long(tag: string): number;
|
|
1052
|
+
/**
|
|
1053
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1054
|
+
* @param tag Exiv2 tag name
|
|
1055
|
+
* @returns The multiple string values of @tag. Returns %NULL if parameters are %NULL or @tag does not begin with recognised type of metadata ("Exif.", "Xmp." or "Iptc."). For a well formed @tag, returns array[0] = %NULL if @tag is undefined or is not set in the current metadata.
|
|
1056
|
+
*/
|
|
1057
|
+
try_get_tag_multiple(tag: string): string[] | null;
|
|
1058
|
+
/**
|
|
1059
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1060
|
+
*
|
|
1061
|
+
* Tags that support multiple values may be returned as a single byte array, with records separated
|
|
1062
|
+
* by 4x INFORMATION SEPARATOR FOUR (ASCII 0x1c)
|
|
1063
|
+
* @param tag Exiv2 tag name
|
|
1064
|
+
* @returns The tag's raw value as a byte array
|
|
1065
|
+
*/
|
|
1066
|
+
try_get_tag_raw(tag: string): GLib.Bytes | null;
|
|
1067
|
+
/**
|
|
1068
|
+
* Get a string representationf a tag.
|
|
1069
|
+
*
|
|
1070
|
+
* Tags that support multiple values are returned as a single string, with elements separated by ", ".
|
|
1071
|
+
*
|
|
1072
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1073
|
+
* @param tag Exiv2 tag name
|
|
1074
|
+
* @returns The tag's value as a string
|
|
1075
|
+
*/
|
|
1076
|
+
try_get_tag_string(tag: string): string | null;
|
|
1077
|
+
/**
|
|
1078
|
+
* Get the currently encoded XMP packet (after having called [method`GExiv2`.Metadata.try_generate_xmp_packet])
|
|
1079
|
+
* @returns %NULL if no packet was generated previously, the XMP packet contents otherwise
|
|
1080
|
+
*/
|
|
1081
|
+
try_get_xmp_packet(): string | null;
|
|
1082
|
+
/**
|
|
1083
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1084
|
+
* @param tag Exiv2 tag
|
|
1085
|
+
* @returns TRUE if the tag is present.
|
|
1086
|
+
*/
|
|
1087
|
+
try_has_tag(tag: string): boolean;
|
|
1088
|
+
/**
|
|
1089
|
+
* This is a composite setter that will set a number of fields to the supplied value. See
|
|
1090
|
+
* [method`Metadata`.get_comment] for more information.
|
|
1091
|
+
* @param comment Comment string to set. Must not be %NULL
|
|
1092
|
+
*/
|
|
1093
|
+
try_set_comment(comment: string): void;
|
|
1094
|
+
/**
|
|
1095
|
+
* Set EXIF `tag` represented by a fraction, with `nom` being the numerator,
|
|
1096
|
+
* `den` the denominator of the fraction.
|
|
1097
|
+
* @param tag The Exiv2 tag
|
|
1098
|
+
* @param nom Rational numerator
|
|
1099
|
+
* @param den Rational denominator
|
|
1100
|
+
* @returns Boolean success value
|
|
1101
|
+
*/
|
|
1102
|
+
try_set_exif_tag_rational(tag: string, nom: number, den: number): boolean;
|
|
1103
|
+
/**
|
|
1104
|
+
* Sets or replaces the EXIF thumbnail with the data in `buffer`.
|
|
1105
|
+
* @param buffer A buffer containing thumbnail data
|
|
1106
|
+
*/
|
|
1107
|
+
try_set_exif_thumbnail_from_buffer(buffer: Uint8Array | string): void;
|
|
1108
|
+
/**
|
|
1109
|
+
* Convenience function to create a new set of simple GPS data. Warning: Will remove any other
|
|
1110
|
+
* GPS information that is currently set. See [method`Metadata`.update_gps_info] for
|
|
1111
|
+
* just modifying the GPS data.
|
|
1112
|
+
* @param longitude Longitude value to set or replace current value.
|
|
1113
|
+
* @param latitude Latitude value to set or replace current value
|
|
1114
|
+
* @param altitude Altitude value to set or replace current value
|
|
1115
|
+
* @returns Boolean success value.
|
|
1116
|
+
*/
|
|
1117
|
+
try_set_gps_info(longitude: number, latitude: number, altitude: number): boolean;
|
|
1118
|
+
/**
|
|
1119
|
+
* Update the image's metadata with `height`
|
|
1120
|
+
* @param height The width of the image as it should be put into the metadata.
|
|
1121
|
+
*/
|
|
1122
|
+
try_set_metadata_pixel_height(height: number): void;
|
|
1123
|
+
/**
|
|
1124
|
+
* Composite setter to update the image's metadata with `width`
|
|
1125
|
+
* @param width The width of the image as it should be put into the metadata
|
|
1126
|
+
*/
|
|
1127
|
+
try_set_metadata_pixel_width(width: number): void;
|
|
1128
|
+
/**
|
|
1129
|
+
* The orientation must be valid and cannot be [enum`GExiv2`.Orientation.UNSPECIFIED.
|
|
1130
|
+
* @param orientation The new [enum@GExiv2.Orientation] for the image.
|
|
1131
|
+
*/
|
|
1132
|
+
try_set_orientation(orientation: Orientation | null): void;
|
|
1133
|
+
/**
|
|
1134
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1135
|
+
* @param tag Exiv2 tag name
|
|
1136
|
+
* @param value The value to set or replace the existing value
|
|
1137
|
+
* @returns TRUE on success
|
|
1138
|
+
*/
|
|
1139
|
+
try_set_tag_long(tag: string, value: number): boolean;
|
|
1140
|
+
/**
|
|
1141
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1142
|
+
*
|
|
1143
|
+
* All previous `tag` values are erased. For multiple value tags, each of the non %NULL
|
|
1144
|
+
* entries in `values` is stored. For single value tags, only the last non %NULL value
|
|
1145
|
+
* is assigned.
|
|
1146
|
+
* @param tag Exiv2 tag name
|
|
1147
|
+
* @param values An array of values to set or replace the existing value(s)
|
|
1148
|
+
* @returns Boolean success value
|
|
1149
|
+
*/
|
|
1150
|
+
try_set_tag_multiple(tag: string, values: string[]): boolean;
|
|
1151
|
+
/**
|
|
1152
|
+
* Set the value of a tag using a string.
|
|
1153
|
+
*
|
|
1154
|
+
* If a tag supports multiple values, then `value` is added to any existing values. For single
|
|
1155
|
+
* tags, `value` replaces the value.
|
|
1156
|
+
*
|
|
1157
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1158
|
+
* @param tag Exiv2 tag name
|
|
1159
|
+
* @param value The value to set or replace the existing value
|
|
1160
|
+
* @returns TRUE on success
|
|
1161
|
+
*/
|
|
1162
|
+
try_set_tag_string(tag: string, value: string): boolean;
|
|
1163
|
+
/**
|
|
1164
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1165
|
+
* @param tag Exiv2 tag name
|
|
1166
|
+
* @param type The GExiv2StructureType specifying the type of structure
|
|
1167
|
+
* @returns TRUE on success
|
|
1168
|
+
*/
|
|
1169
|
+
try_set_xmp_tag_struct(tag: string, type: StructureType | null): boolean;
|
|
1170
|
+
/**
|
|
1171
|
+
* Check whether a tag supports multiple values.
|
|
1172
|
+
*
|
|
1173
|
+
* Multiple value tags are Xmp tags of type "XmpAlt", "XmpBag", "XmpSeq" or "LangAlt", or Iptc
|
|
1174
|
+
* tags marked as Repeatable (which can be of any Iptc type). There are no multiple value Exif
|
|
1175
|
+
* tags.
|
|
1176
|
+
*
|
|
1177
|
+
* The Exiv2 Tag Reference can be found at <http://exiv2.org/metadata.html>
|
|
1178
|
+
* @param tag An Exiv2 tag
|
|
1179
|
+
* @returns Whether @tag is capable of storing multiple values or not. If @tag is undefined (i.e. not built-in and not added to @self), then @error is set and %FALSE is returned.
|
|
1180
|
+
*/
|
|
1181
|
+
try_tag_supports_multiple_values(tag: string): boolean;
|
|
1182
|
+
/**
|
|
1183
|
+
* Convenience function to update longitude, latitude and altitude at once.
|
|
1184
|
+
* @param longitude Longitude value to set or replace current value
|
|
1185
|
+
* @param latitude Latitude value to set or replace current value
|
|
1186
|
+
* @param altitude Altitude value to set or replace current value
|
|
1187
|
+
* @returns Boolean success value.
|
|
1188
|
+
*/
|
|
1189
|
+
try_update_gps_info(longitude: number, latitude: number, altitude: number): boolean;
|
|
1190
|
+
/**
|
|
1191
|
+
* Convenience function to update longitude, latitude and altitude at once.
|
|
1192
|
+
* @param longitude Longitude value to set or replace current value
|
|
1193
|
+
* @param latitude Latitude value to set or replace current value
|
|
1194
|
+
* @param altitude Altitude value to set or replace current value
|
|
1195
|
+
* @returns Boolean success value.
|
|
1196
|
+
*/
|
|
1197
|
+
update_gps_info(longitude: number, latitude: number, altitude: number): boolean;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
namespace PreviewImage {
|
|
1201
|
+
// Signal signatures
|
|
1202
|
+
interface SignalSignatures extends GObject.Object.SignalSignatures {}
|
|
1203
|
+
|
|
1204
|
+
// Constructor properties interface
|
|
1205
|
+
|
|
1206
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* An accessor to the preview images contained in the image's metadata.
|
|
1211
|
+
*
|
|
1212
|
+
* This could be anything from a thumbnail to a full-sized camera development
|
|
1213
|
+
* of a RAW image.
|
|
1214
|
+
*
|
|
1215
|
+
* The `GExiv2PreviewImage` is obtained by calling gexiv2_metadata_get_preview_image()
|
|
1216
|
+
* with an instance of #GExiv2PreviewProperties that are describing the image
|
|
1217
|
+
* to be fetched.
|
|
1218
|
+
*
|
|
1219
|
+
* ```c
|
|
1220
|
+
* GExiv2PreviewProperties **properties, **it;
|
|
1221
|
+
* properties = it = gexiv2_metadata_get_preview_properties(metadata);
|
|
1222
|
+
*
|
|
1223
|
+
* while (*it) {
|
|
1224
|
+
* preview_image = gexiv2_metadata_get_preview_image(metadata, *it);
|
|
1225
|
+
* it++;
|
|
1226
|
+
* }
|
|
1227
|
+
* ```
|
|
1228
|
+
*/
|
|
1229
|
+
class PreviewImage extends GObject.Object {
|
|
1230
|
+
static $gtype: GObject.GType<PreviewImage>;
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Compile-time signal type information.
|
|
1234
|
+
*
|
|
1235
|
+
* This instance property is generated only for TypeScript type checking.
|
|
1236
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
1237
|
+
* @internal
|
|
1238
|
+
*/
|
|
1239
|
+
$signals: PreviewImage.SignalSignatures;
|
|
1240
|
+
|
|
1241
|
+
// Constructors
|
|
1242
|
+
|
|
1243
|
+
constructor(properties?: Partial<PreviewImage.ConstructorProps>, ...args: any[]);
|
|
1244
|
+
|
|
1245
|
+
_init(...args: any[]): void;
|
|
1246
|
+
|
|
1247
|
+
// Signals
|
|
1248
|
+
|
|
1249
|
+
connect<K extends keyof PreviewImage.SignalSignatures>(
|
|
1250
|
+
signal: K,
|
|
1251
|
+
callback: GObject.SignalCallback<this, PreviewImage.SignalSignatures[K]>,
|
|
1252
|
+
): number;
|
|
1253
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
1254
|
+
connect_after<K extends keyof PreviewImage.SignalSignatures>(
|
|
1255
|
+
signal: K,
|
|
1256
|
+
callback: GObject.SignalCallback<this, PreviewImage.SignalSignatures[K]>,
|
|
1257
|
+
): number;
|
|
1258
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
1259
|
+
emit<K extends keyof PreviewImage.SignalSignatures>(
|
|
1260
|
+
signal: K,
|
|
1261
|
+
...args: GObject.GjsParameters<PreviewImage.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
1262
|
+
): void;
|
|
1263
|
+
emit(signal: string, ...args: any[]): void;
|
|
1264
|
+
|
|
1265
|
+
// Methods
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Get a pointer to the image data of the preview image. The returned data is
|
|
1269
|
+
* owned by the preview image and must not be freed.
|
|
1270
|
+
* @returns The raw image data
|
|
1271
|
+
*/
|
|
1272
|
+
get_data(): Uint8Array;
|
|
1273
|
+
// Conflicted with GObject.Object.get_data
|
|
1274
|
+
get_data(...args: never[]): any;
|
|
1275
|
+
/**
|
|
1276
|
+
* Get the file extension commonly associated with the preview image
|
|
1277
|
+
* @returns The preview image's recommended file extension.
|
|
1278
|
+
*/
|
|
1279
|
+
get_extension(): string;
|
|
1280
|
+
/**
|
|
1281
|
+
* Get the height in pixels
|
|
1282
|
+
* @returns The preview image's display height in pixels.
|
|
1283
|
+
*/
|
|
1284
|
+
get_height(): number;
|
|
1285
|
+
/**
|
|
1286
|
+
* Get the MIME type associated with the preview image.
|
|
1287
|
+
* @returns The preview image's MIME type.
|
|
1288
|
+
*/
|
|
1289
|
+
get_mime_type(): string;
|
|
1290
|
+
/**
|
|
1291
|
+
* Get the width in pixels
|
|
1292
|
+
* @returns The preview image's display width in pixels.
|
|
1293
|
+
*/
|
|
1294
|
+
get_width(): number;
|
|
1295
|
+
/**
|
|
1296
|
+
* Write the preview image to a file in `path`
|
|
1297
|
+
* @param path The file path to write the preview image to.
|
|
1298
|
+
* @returns The number of bytes written to the file.
|
|
1299
|
+
*/
|
|
1300
|
+
try_write_file(path: string): number;
|
|
1301
|
+
/**
|
|
1302
|
+
* Write the preview image to a file in `path`
|
|
1303
|
+
* @param path The file path to write the preview image to.
|
|
1304
|
+
* @returns The number of bytes written to the file.
|
|
1305
|
+
*/
|
|
1306
|
+
write_file(path: string): number;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
namespace PreviewProperties {
|
|
1310
|
+
// Signal signatures
|
|
1311
|
+
interface SignalSignatures extends GObject.Object.SignalSignatures {}
|
|
1312
|
+
|
|
1313
|
+
// Constructor properties interface
|
|
1314
|
+
|
|
1315
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* Properties of a preview image.
|
|
1320
|
+
*
|
|
1321
|
+
* Metadata can contain multiple preview images. [class`GExiv2`.PreviewProperties] are
|
|
1322
|
+
* used to describe the available image without the need of fetching the whole
|
|
1323
|
+
* image from the metadata.
|
|
1324
|
+
*/
|
|
1325
|
+
class PreviewProperties extends GObject.Object {
|
|
1326
|
+
static $gtype: GObject.GType<PreviewProperties>;
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* Compile-time signal type information.
|
|
1330
|
+
*
|
|
1331
|
+
* This instance property is generated only for TypeScript type checking.
|
|
1332
|
+
* It is not defined at runtime and should not be accessed in JS code.
|
|
1333
|
+
* @internal
|
|
1334
|
+
*/
|
|
1335
|
+
$signals: PreviewProperties.SignalSignatures;
|
|
1336
|
+
|
|
1337
|
+
// Constructors
|
|
1338
|
+
|
|
1339
|
+
constructor(properties?: Partial<PreviewProperties.ConstructorProps>, ...args: any[]);
|
|
1340
|
+
|
|
1341
|
+
_init(...args: any[]): void;
|
|
1342
|
+
|
|
1343
|
+
// Signals
|
|
1344
|
+
|
|
1345
|
+
connect<K extends keyof PreviewProperties.SignalSignatures>(
|
|
1346
|
+
signal: K,
|
|
1347
|
+
callback: GObject.SignalCallback<this, PreviewProperties.SignalSignatures[K]>,
|
|
1348
|
+
): number;
|
|
1349
|
+
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
1350
|
+
connect_after<K extends keyof PreviewProperties.SignalSignatures>(
|
|
1351
|
+
signal: K,
|
|
1352
|
+
callback: GObject.SignalCallback<this, PreviewProperties.SignalSignatures[K]>,
|
|
1353
|
+
): number;
|
|
1354
|
+
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
1355
|
+
emit<K extends keyof PreviewProperties.SignalSignatures>(
|
|
1356
|
+
signal: K,
|
|
1357
|
+
...args: GObject.GjsParameters<PreviewProperties.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
1358
|
+
): void;
|
|
1359
|
+
emit(signal: string, ...args: any[]): void;
|
|
1360
|
+
|
|
1361
|
+
// Methods
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* Get the recommended file extension for the preview image.
|
|
1365
|
+
* @returns The recommended file extension for the preview image.
|
|
1366
|
+
*/
|
|
1367
|
+
get_extension(): string;
|
|
1368
|
+
/**
|
|
1369
|
+
* Get the preview image's display height in pixels.
|
|
1370
|
+
* @returns The preview image's display height in pixels.
|
|
1371
|
+
*/
|
|
1372
|
+
get_height(): number;
|
|
1373
|
+
/**
|
|
1374
|
+
* Get the preview image's content-type.
|
|
1375
|
+
* @returns The preview image's MIME type.
|
|
1376
|
+
*/
|
|
1377
|
+
get_mime_type(): string;
|
|
1378
|
+
/**
|
|
1379
|
+
* Returns the size of the preview image in bytes.
|
|
1380
|
+
* @returns The preview image size in bytes.
|
|
1381
|
+
*/
|
|
1382
|
+
get_size(): number;
|
|
1383
|
+
/**
|
|
1384
|
+
* Get the preview image's display width in pixels
|
|
1385
|
+
* @returns The preview image's display width in pixels.
|
|
1386
|
+
*/
|
|
1387
|
+
get_width(): number;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
type MetadataClass = typeof Metadata;
|
|
1391
|
+
type PreviewImageClass = typeof PreviewImage;
|
|
1392
|
+
type PreviewPropertiesClass = typeof PreviewProperties;
|
|
1393
|
+
/**
|
|
1394
|
+
* Name of the imported GIR library
|
|
1395
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
1396
|
+
*/
|
|
1397
|
+
const __name__: string;
|
|
1398
|
+
/**
|
|
1399
|
+
* Version of the imported GIR library
|
|
1400
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
1401
|
+
*/
|
|
1402
|
+
const __version__: string;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
export default GExiv2;
|
|
1406
|
+
|
|
1407
|
+
// END
|