" <entry key = 'formatted.SubjectDistance' if_set = 'true' editable = 'false' />"
" <entry key = 'formatted.Resolution' if_set = 'true' editable = 'false' />"
" <entry key = '" ORIENTATION_KEY "' if_set = 'true' editable = 'false' />"
+" <entry key = 'formatted.star_rating' if_set = 'true' editable = 'false' />"
" </pane_exif>"
" </bar>"
" </layout>"
return time_zone;
}
+static gchar *exif_build_formatted_star_rating(ExifData *exif)
+{
+ gint n;
+ gchar *ret = NULL;
+ GString *str = g_string_new(NULL);
+
+ exif_get_integer(exif, "Xmp.xmp.Rating", &n);
+
+ if (n == -1)
+ {
+ ret = g_strdup("⨷");
+ }
+ else if (n > 0 && n < 6)
+ {
+ while (n > 0)
+ {
+ str = g_string_append(str, "🟊");
+ n = n - 1;
+ }
+ ret = g_strdup(str->str);
+ g_string_free(str, TRUE);
+ }
+
+ return ret;
+}
+
/* List of custom formatted pseudo-exif tags */
#define EXIF_FORMATTED_TAG(name, label) { EXIF_FORMATTED()#name, label, exif_build_formatted##_##name }
EXIF_FORMATTED_TAG(GPSAltitude, N_("GPS altitude")),
EXIF_FORMATTED_TAG(localtime, N_("Local time")),
EXIF_FORMATTED_TAG(timezone, N_("Time zone")),
+ EXIF_FORMATTED_TAG(star_rating, N_("Star rating")),
{"file.size", N_("File size"), NULL},
{"file.date", N_("File date"), NULL},
{"file.mode", N_("File mode"), NULL},
"(%number%/%total%) [%zoom%] <b>%name%</b>\n" \
"%res%|%date%|%size%\n" \
"%formatted.Aperture%|%formatted.ShutterSpeed%|%formatted.ISOSpeedRating:ISO *%|%formatted.FocalLength%|%formatted.ExposureBias:* Ev%\n" \
- "%formatted.Camera:40%|%formatted.Flash%"
+ "%formatted.Camera:40%|%formatted.Flash%\n" \
+ "%formatted.star_rating%"
#define GQ_LINK_STR "↗"
#include "typedefs.h"