summaryrefslogtreecommitdiff
path: root/src/info.h
blob: 7680b720a4c7c6074608dc55a77c99ee56e8ae79 (plain)
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
#ifndef GGAZE_INFO_H
#define GGAZE_INFO_H

/*:*
 * ggaze — image info / EXIF gather
 *
 * Gathers file info (dimensions, format, size) + EXIF (camera, lens, focal,
 * aperture, shutter, ISO, datetime, orientation) into a GgazeInfo struct.
 * Plain-C, no GtkWidget; uses GdkPixbuf (dims) + libexif (EXIF). Unit-testable.
 *
 * Copyright (c) 2026 ggaze contributors
 * SPDX-License-Identifier: GPL-3.0-or-later
 *:*/

#include <gio/gio.h>
#include <glib.h>

G_BEGIN_DECLS

typedef struct {
   int    i_width;
   int    i_height;
   char  *c_format;      /* content type (owned) */
   gint64 i_size;        /* file size in bytes */
   char  *c_camera;      /* Make + Model (owned) */
   char  *c_lens;        /* Lens model (owned, or NULL) */
   char  *c_focal;       /* FocalLength (owned) */
   char  *c_aperture;    /* FNumber (owned) */
   char  *c_shutter;     /* ExposureTime (owned) */
   char  *c_iso;         /* ISOSpeedRatings (owned) */
   char  *c_datetime;    /* DateTimeOriginal (owned) */
   int    i_orientation; /* EXIF Orientation (1-8, 0 if none) */
} GgazeInfo;

/* Gather info for p_file (synchronous). Returns a new GgazeInfo (caller owns,
 * free with info_delete) or NULL on failure. */
GgazeInfo *info_new(GFile *p_file);
void       info_delete(GgazeInfo *p_info);

/* Format the info as a multi-line string (caller frees). */
char *info_format(const GgazeInfo *p_info);

G_END_DECLS

#endif /* GGAZE_INFO_H */