plugins/camera-import/Makefile
plugins/image-crop/Makefile
plugins/random-image/Makefile
+ plugins/lens/Makefile
geeqie.spec
])
<entry>file.page_no</entry>\r
<entry>if the file is a multi-page file, e.g. .tiff, the current page number and page total is displayed (e.g. [2/10])</entry>\r
</row>\r
+ <row>\r
+ <entry>lua.lensID</entry>\r
+ <entry>\r
+ lens identification data\r
+ <footnote id='lensid'>\r
+ Requires lua and exiftool.\r
+ <note>This function may be slow.</note>\r
+ </footnote>\r
+ </entry>\r
+ </row>\r
<row>\r
<entry>lua.<lua script></entry>\r
<entry>\r
-SUBDIRS = rotate symlink ufraw geocode-parameters export-jpeg tethered-photography camera-import image-crop random-image
+SUBDIRS = rotate symlink ufraw geocode-parameters export-jpeg tethered-photography camera-import image-crop random-image lens
qq_desktoptemplatedir = $(appdir)
qq_desktoptemplate_in_files = template.desktop.in
qq_desktoptemplate_DATA = $(qq_desktoptemplate_in_files:.desktop.in=.desktop)
--- /dev/null
+dist_gq_bin_SCRIPTS = lensID
--- /dev/null
+-- Retrieve the lens ID data
+-- Called from the pre-formatted tag lua.lensID
+-- Requires lua and extftool
+-- Runs rather slow
+
+n = 0
+m = 0
+lensID = ""
+lensIDstring = ""
+
+path = Image:get_path()
+
+lensIDfile = io.popen("exiftool -Composite:LensID \"" .. path .. "\" 2>/dev/null ")
+lensID = lensIDfile:read("*a")
+
+if lensID ~= ""
+then
+ n = string.find(lensID, ":")
+ if n > 2
+ then
+ n = n + 2
+ lensIDstring = string.sub(lensID, n)
+ m = string.find(lensIDstring, "Unknown")
+ if m ~= nil
+ then
+ lensIDstring = ""
+ else
+ lensIDstring = string.gsub(lensIDstring, "\n", "")
+ end
+ end
+end
+
+lensIDfile:close()
+return (lensIDstring)
{"file.link", N_("File link"), NULL},
{"file.class", N_("File class"), NULL},
{"file.page_no", N_("Page no."), NULL},
+ {"lua.lensID", N_("Lens"), NULL},
{ NULL, NULL, NULL }
};
{
if (!key) return NULL;
- if (strncmp(key, EXIF_FORMATTED(), EXIF_FORMATTED_LEN) == 0 ||
- strncmp(key, "file.", 5) == 0)
+ if (strncmp(key, EXIF_FORMATTED(), EXIF_FORMATTED_LEN) == 0 || strncmp(key, "file.", 5) == 0 || strncmp(key, "lua.", 4) == 0)
{
gint i;
FileData **image_data;
gchar *tmp;
GError *error = NULL;
+ gboolean ok;
+
+ ok = access(g_build_filename(get_rc_dir(), "lua", file, NULL), R_OK);
+ if (ok == 0)
+ {
+ path = g_build_filename(get_rc_dir(), "lua", file, NULL);
+ }
+ else
+ {
+ /* FIXME: what is the correct way to find the scripts folder? */
+ ok = access(g_build_filename("/usr/local/lib", GQ_APPNAME_LC, file, NULL), R_OK);
+ if (ok == 0)
+ {
+ path = g_build_filename("/usr/local/lib", GQ_APPNAME_LC, file, NULL);
+ }
+ else
+ {
+ return g_strdup("");
+ }
+ }
/* Collection Table (Dummy at the moment) */
lua_newtable(L);
}
else
{
- dir = g_build_filename(get_rc_dir(), "lua", NULL);
- path = g_build_filename(dir, file, NULL);
result = luaL_dofile(L, path);
g_free(path);
g_free(dir);
{"%formatted.ExposureBias%", N_("Exposure bias")},
{"%formatted.Resolution%", N_("Resolution")},
{"%formatted.Camera%", N_("Camera")},
+ {"%lua.lensID%", N_("Lens")},
{"%formatted.ISOSpeedRating%", N_("ISO")},
{"%formatted.FocalLength%", N_("Focal length")},
{"%formatted.FocalLength35mmFilm%", N_("Focal len. 35mm")},
{
CollectWindow *w;
GList *list;
-DEBUG_0(" ");
list = search_result_selection_list(sd);
w = collection_window_new(NULL);