Unverified Commit 31e0feba authored by Heiko Bauke's avatar Heiko Bauke Committed by Tobias Ellinghaus

watermark: support for tags and ratings

(cherry picked from commit ca00a3ff)
parent 72e158f2
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with darktable. If not, see <http://www.gnu.org/licenses/>. along with darktable. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "bauhaus/bauhaus.h" #include "bauhaus/bauhaus.h"
#include "common/tags.h"
#include "control/control.h" #include "control/control.h"
#include "develop/develop.h" #include "develop/develop.h"
#include "develop/imageop.h" #include "develop/imageop.h"
...@@ -718,6 +720,29 @@ static gchar *_watermark_get_svgdoc(dt_iop_module_t *self, dt_iop_watermark_data ...@@ -718,6 +720,29 @@ static gchar *_watermark_get_svgdoc(dt_iop_module_t *self, dt_iop_watermark_data
g_list_free_full(res, &g_free); g_list_free_full(res, &g_free);
} }
res = dt_tag_get_list(image->id);
gchar *keywords = dt_util_glist_to_str(", ", res);
svgdoc = _string_substitute(svgdata, "$(IMAGE.TAGS)", (keywords ? keywords : ""));
if(svgdoc != svgdata)
{
g_free(svgdata);
svgdata = svgdoc;
}
g_free(keywords);
if(res)
{
g_list_free_full(res, &g_free);
}
const int stars = image->flags & 0x7;
const char *const rating_str[] = { "☆☆☆☆☆", "★☆☆☆☆", "★★☆☆☆", "★★★☆☆", "★★★★☆", "★★★★★", "❌", "" };
svgdoc = _string_substitute(svgdata, "$(Xmp.xmp.Rating)", rating_str[stars]);
if(svgdoc != svgdata)
{
g_free(svgdata);
svgdata = svgdoc;
}
// geolocation // geolocation
gchar *latitude = NULL, *longitude = NULL, *elevation = NULL; gchar *latitude = NULL, *longitude = NULL, *elevation = NULL;
if(dt_conf_get_bool("plugins/lighttable/metadata_view/pretty_location")) if(dt_conf_get_bool("plugins/lighttable/metadata_view/pretty_location"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment