# HG changeset patch # User zas_ # Date 1209847250 0 # Node ID db08ccd54169c91ef09218bdacacf9fec9f563b0 # Parent 85b9cec260bc553f526ea0c933978b1ec42ef2e4 Change the prefix of formatted exif tags to a more explicit "formatted." prefix instead of the shorter "f". Warning: custom overlay info string has to be modified since old names are no more recognized, one can reset it to default through Preferences > Advanced. diff -r 85b9cec260bc -r db08ccd54169 src/bar_exif.c --- a/src/bar_exif.c Sat May 03 16:58:17 2008 +0000 +++ b/src/bar_exif.c Sat May 03 20:40:50 2008 +0000 @@ -29,22 +29,22 @@ #define BAR_EXIF_DATA_COLUMN_WIDTH 250 ExifUI ExifUIList[]={ - { 0, 0, EXIF_UI_IFSET, "fCamera"}, - { 0, 0, EXIF_UI_IFSET, "fDateTime"}, - { 0, 0, EXIF_UI_IFSET, "fShutterSpeed"}, - { 0, 0, EXIF_UI_IFSET, "fAperture"}, - { 0, 0, EXIF_UI_IFSET, "fExposureBias"}, - { 0, 0, EXIF_UI_IFSET, "fISOSpeedRating"}, - { 0, 0, EXIF_UI_IFSET, "fFocalLength"}, - { 0, 0, EXIF_UI_IFSET, "fFocalLength35mmFilm"}, - { 0, 0, EXIF_UI_IFSET, "fFlash"}, - { 0, 0, EXIF_UI_IFSET, "fSubjectDistance"}, + { 0, 0, EXIF_UI_IFSET, "formatted.Camera"}, + { 0, 0, EXIF_UI_IFSET, "formatted.DateTime"}, + { 0, 0, EXIF_UI_IFSET, "formatted.ShutterSpeed"}, + { 0, 0, EXIF_UI_IFSET, "formatted.Aperture"}, + { 0, 0, EXIF_UI_IFSET, "formatted.ExposureBias"}, + { 0, 0, EXIF_UI_IFSET, "formatted.ISOSpeedRating"}, + { 0, 0, EXIF_UI_IFSET, "formatted.FocalLength"}, + { 0, 0, EXIF_UI_IFSET, "formatted.FocalLength35mmFilm"}, + { 0, 0, EXIF_UI_IFSET, "formatted.Flash"}, + { 0, 0, EXIF_UI_IFSET, "formatted.SubjectDistance"}, { 0, 0, EXIF_UI_IFSET, "Exif.Photo.ExposureProgram"}, { 0, 0, EXIF_UI_IFSET, "Exif.Photo.MeteringMode"}, { 0, 0, EXIF_UI_IFSET, "Exif.Photo.LightSource"}, - { 0, 0, EXIF_UI_IFSET, "fColorProfile"}, - { 0, 0, EXIF_UI_IFSET, "fSubjectDistance"}, - { 0, 0, EXIF_UI_IFSET, "fResolution"}, + { 0, 0, EXIF_UI_IFSET, "formatted.ColorProfile"}, + { 0, 0, EXIF_UI_IFSET, "formatted.SubjectDistance"}, + { 0, 0, EXIF_UI_IFSET, "formatted.Resolution"}, { 0, 0, EXIF_UI_IFSET, "Exif.Image.Orientation"}, { 0, 0, EXIF_UI_IFSET, "Exif.Image.ImageDescription"}, { 0, 0, EXIF_UI_IFSET, "Exif.Image.Copyright"}, diff -r 85b9cec260bc -r db08ccd54169 src/cache-loader.c --- a/src/cache-loader.c Sat May 03 16:58:17 2008 +0000 +++ b/src/cache-loader.c Sat May 03 20:40:50 2008 +0000 @@ -131,7 +131,7 @@ { gchar *text; - text = exif_get_data_as_text(exif, "fDateTime"); + text = exif_get_data_as_text(exif, "formatted.DateTime"); if (text) { struct tm t = { 0 }; diff -r 85b9cec260bc -r db08ccd54169 src/exif-common.c --- a/src/exif-common.c Sat May 03 16:58:17 2008 +0000 +++ b/src/exif-common.c Sat May 03 20:40:50 2008 +0000 @@ -131,7 +131,7 @@ return TRUE; } -static gchar *exif_build_fCamera(ExifData *exif) +static gchar *exif_build_formatted_Camera(ExifData *exif) { gchar *text; gchar *make = exif_get_data_as_text(exif, "Exif.Image.Make"); @@ -184,7 +184,7 @@ return text; } -static gchar *exif_build_fDateTime(ExifData *exif) +static gchar *exif_build_formatted_DateTime(ExifData *exif) { gchar *text = exif_get_data_as_text(exif, "Exif.Photo.DateTimeOriginal"); gchar *subsec = NULL; @@ -205,7 +205,7 @@ return text; } -static gchar *exif_build_fShutterSpeed(ExifData *exif) +static gchar *exif_build_formatted_ShutterSpeed(ExifData *exif) { ExifRational *r; @@ -230,7 +230,7 @@ return NULL; } -static gchar *exif_build_fAperture(ExifData *exif) +static gchar *exif_build_formatted_Aperture(ExifData *exif) { double n; @@ -241,7 +241,7 @@ return g_strdup_printf("f/%.1f", n); } -static gchar *exif_build_fExposureBias(ExifData *exif) +static gchar *exif_build_formatted_ExposureBias(ExifData *exif) { ExifRational *r; gint sign; @@ -254,7 +254,7 @@ return g_strdup_printf("%+.1f", n); } -static gchar *exif_build_fFocalLength(ExifData *exif) +static gchar *exif_build_formatted_FocalLength(ExifData *exif) { double n; @@ -263,7 +263,7 @@ return g_strdup_printf("%.0f mm", n); } -static gchar *exif_build_fFocalLength35mmFilm(ExifData *exif) +static gchar *exif_build_formatted_FocalLength35mmFilm(ExifData *exif) { gint n; double f, c; @@ -284,7 +284,7 @@ return NULL; } -static gchar *exif_build_fISOSpeedRating(ExifData *exif) +static gchar *exif_build_formatted_ISOSpeedRating(ExifData *exif) { gchar *text; @@ -294,7 +294,7 @@ return text; } -static gchar *exif_build_fSubjectDistance(ExifData *exif) +static gchar *exif_build_formatted_SubjectDistance(ExifData *exif) { ExifRational *r; gint sign; @@ -311,7 +311,7 @@ return g_strdup_printf("%.3f m", n); } -static gchar *exif_build_fFlash(ExifData *exif) +static gchar *exif_build_formatted_Flash(ExifData *exif) { /* grr, flash is a bitmask... */ GString *string; @@ -361,7 +361,7 @@ return text; } -static gchar *exif_build_fResolution(ExifData *exif) +static gchar *exif_build_formatted_Resolution(ExifData *exif) { ExifRational *rx, *ry; gchar *units; @@ -380,7 +380,7 @@ return text; } -static gchar *exif_build_fColorProfile(ExifData *exif) +static gchar *exif_build_formatted_ColorProfile(ExifData *exif) { const gchar *name = ""; const gchar *source = ""; @@ -434,28 +434,27 @@ /* List of custom formatted pseudo-exif tags */ -#define EXIF_FORMATTED_TAG(name, label) { #name, label, exif_build##_##name } +#define EXIF_FORMATTED_TAG(name, label) { "formatted."#name, label, exif_build_formatted##_##name } ExifFormattedText ExifFormattedList[] = { - EXIF_FORMATTED_TAG(fCamera, N_("Camera")), - EXIF_FORMATTED_TAG(fDateTime, N_("Date")), - EXIF_FORMATTED_TAG(fShutterSpeed, N_("Shutter speed")), - EXIF_FORMATTED_TAG(fAperture, N_("Aperture")), - EXIF_FORMATTED_TAG(fExposureBias, N_("Exposure bias")), - EXIF_FORMATTED_TAG(fISOSpeedRating, N_("ISO sensitivity")), - EXIF_FORMATTED_TAG(fFocalLength, N_("Focal length")), - EXIF_FORMATTED_TAG(fFocalLength35mmFilm,N_("Focal length 35mm")), - EXIF_FORMATTED_TAG(fSubjectDistance, N_("Subject distance")), - EXIF_FORMATTED_TAG(fFlash, N_("Flash")), - EXIF_FORMATTED_TAG(fResolution, N_("Resolution")), - EXIF_FORMATTED_TAG(fColorProfile, N_("Color profile")), + EXIF_FORMATTED_TAG(Camera, N_("Camera")), + EXIF_FORMATTED_TAG(DateTime, N_("Date")), + EXIF_FORMATTED_TAG(ShutterSpeed, N_("Shutter speed")), + EXIF_FORMATTED_TAG(Aperture, N_("Aperture")), + EXIF_FORMATTED_TAG(ExposureBias, N_("Exposure bias")), + EXIF_FORMATTED_TAG(ISOSpeedRating, N_("ISO sensitivity")), + EXIF_FORMATTED_TAG(FocalLength, N_("Focal length")), + EXIF_FORMATTED_TAG(FocalLength35mmFilm, N_("Focal length 35mm")), + EXIF_FORMATTED_TAG(SubjectDistance, N_("Subject distance")), + EXIF_FORMATTED_TAG(Flash, N_("Flash")), + EXIF_FORMATTED_TAG(Resolution, N_("Resolution")), + EXIF_FORMATTED_TAG(ColorProfile, N_("Color profile")), { NULL, NULL, NULL } }; gchar *exif_get_formatted_by_key(ExifData *exif, const gchar *key, gint *key_valid) { - /* must begin with f, else not formatted */ - if (key[0] == 'f') + if (strncmp(key, "formatted.", 10) == 0) { gint i; diff -r 85b9cec260bc -r db08ccd54169 src/main.h --- a/src/main.h Sat May 03 16:58:17 2008 +0000 +++ b/src/main.h Sat May 03 20:40:50 2008 +0000 @@ -107,8 +107,8 @@ #define DEFAULT_OVERLAY_INFO "%collection%(%number%/%total%) [%zoom%] %name%\n" \ "%res%|%date%|%size%\n" \ - "%fAperture%|%fShutterSpeed%|%fISOSpeedRating%|%fFocalLength%|%fExposureBias%\n" \ - "%fCamera%|%fFlash%" \ + "%formatted.Aperture%|%formatted.ShutterSpeed%|%formatted.ISOSpeedRating%|%formatted.FocalLength%|%formatted.ExposureBias%\n" \ + "%formatted.Camera%|%formatted.Flash%" \ #include "typedefs.h" diff -r 85b9cec260bc -r db08ccd54169 src/preferences.c --- a/src/preferences.c Sat May 03 16:58:17 2008 +0000 +++ b/src/preferences.c Sat May 03 20:40:50 2008 +0000 @@ -1339,11 +1339,11 @@ _("%name% results in the filename of the picture.\n" "Also available: %collection%, %number%, %total%, %date%,\n" "%size% (filesize), %width%, %height%, %res% (resolution)\n" - "To access exif data use the exif name, e. g. %fCamera% is the formatted camera name,\n" + "To access exif data use the exif name, e. g. %formatted.Camera% is the formatted camera name,\n" "%Exif.Photo.DateTimeOriginal% the date of the original shot.\n" - "%fCamera:20 notation will truncate the displayed data to 20 characters and will add 3 dots at the end to denote the truncation.\n" + "%formatted.Camera:20 notation will truncate the displayed data to 20 characters and will add 3 dots at the end to denote the truncation.\n" "If two or more variables are connected with the |-sign, it prints available variables with a separator.\n" - "%fShutterSpeed%|%fISOSpeedRating%|%fFocalLength% could show \"1/20s - 400 - 80 mm\" or \"1/200 - 80 mm\",\n" + "%formatted.ShutterSpeed%|%formatted.ISOSpeedRating%|%formatted.FocalLength% could show \"1/20s - 400 - 80 mm\" or \"1/200 - 80 mm\",\n" "if there's no ISO information in the Exif data.\n" "If a line is empty, it is removed. This allows to add lines that totally disappear when no data is available.\n" ));