diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2014-03-18 10:46:32 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2014-03-18 10:46:32 +0100 |
| commit | 98ee28f049415750b2bb5d9f3eb386a83696cddc (patch) | |
| tree | 44bfab0208e7854e3bcd134287498d59634e9e9f /src/items.c | |
| parent | ef1d22999ea6de81f0eb0c58a92da5fa750ee393 (diff) | |
| download | cataract-98ee28f049415750b2bb5d9f3eb386a83696cddc.tar.xz | |
Add support for specifying custom focal length and aperture
Similar to using supplied timestamps this is useful for fully manual
lenses that don't provide any information to the camera.
Diffstat (limited to 'src/items.c')
| -rw-r--r-- | src/items.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/items.c b/src/items.c index 31ab41f..b3f1fac 100644 --- a/src/items.c +++ b/src/items.c @@ -183,6 +183,9 @@ parse_album_xml (const gchar *filename, TPathInfo *path_info) index->metadata_fake_datetime = parse_datetime_string (s); g_free (s); } + index->metadata_fake_aperture = xml_file_get_node_attribute_double (xml, "/gallery/general/metadata/fake", "aperture", -1); + index->metadata_fake_focal_length = xml_file_get_node_attribute_double (xml, "/gallery/general/metadata/fake", "focal_length", -1); + /* TODO: add support for lens name */ s = xml_file_get_node_attribute (xml, "/gallery/general/thumbnail", "crop"); if (s != NULL) { @@ -329,11 +332,14 @@ parse_album_xml (const gchar *filename, TPathInfo *path_info) item->metadata_fake_datetime = (time_t) -1; s = g_strdup_printf ("/gallery/items/*[%d]/metadata/fake", i + 1); s2 = xml_file_get_node_attribute (xml, s, "date"); - g_free (s); if (s2 != NULL) { item->metadata_fake_datetime = parse_datetime_string (s2); g_free (s2); } + item->metadata_fake_aperture = xml_file_get_node_attribute_double (xml, s, "aperture", -1); + item->metadata_fake_focal_length = xml_file_get_node_attribute_double (xml, s, "focal_length", -1); + /* TODO: add support for lens name */ + g_free (s); s = g_strdup_printf ("/gallery/items/*[%d]/thumbnail", i + 1); s2 = xml_file_get_node_attribute (xml, s, "crop"); |
