Merge branch 'roman-metadata_editor'
This commit is contained in:
commit
bc8683fe72
6 changed files with 259 additions and 97 deletions
|
|
@ -50,6 +50,8 @@
|
|||
void gimp_metadata_store_exif (gint32 image_ID,
|
||||
ExifData *exif_data)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
GimpParasite *parasite = NULL;
|
||||
guchar *exif_buf = NULL;
|
||||
guint exif_buf_len = 0;
|
||||
|
|
@ -64,6 +66,14 @@ void gimp_metadata_store_exif (gint32 image_ID,
|
|||
gimp_image_parasite_attach (image_ID, parasite);
|
||||
gimp_parasite_free (parasite);
|
||||
}
|
||||
return_vals = gimp_run_procedure ("plug-in-metadata-decode-exif",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_INT32, exif_data->size,
|
||||
GIMP_PDB_INT8ARRAY, exif_data,
|
||||
GIMP_PDB_END);
|
||||
if (return_vals[0].data.d_status != GIMP_PDB_SUCCESS)
|
||||
g_warning ("JPEG Exif -> XMP Merge failed");
|
||||
|
||||
free (exif_buf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ metadata_SOURCES = \
|
|||
xmp-encode.h \
|
||||
xmp-encode.c \
|
||||
xmp-schemas.h \
|
||||
xmp-schemas.c
|
||||
# interface.h \
|
||||
# interface.c \
|
||||
# exif-decode.h \
|
||||
# exif-decode.c \
|
||||
xmp-schemas.c \
|
||||
interface.h \
|
||||
interface.c \
|
||||
exif-decode.h \
|
||||
exif-decode.c
|
||||
# exif-encode.h \
|
||||
# exif-encode.c \
|
||||
# iptc-decode.h \
|
||||
|
|
@ -56,10 +56,12 @@ INCLUDES = \
|
|||
|
||||
LDADD = \
|
||||
$(libgimp) \
|
||||
$(libgimpui) \
|
||||
$(libgimpconfig) \
|
||||
$(libgimpcolor) \
|
||||
$(libgimpbase) \
|
||||
$(libgimpmath) \
|
||||
$(EXIF_LIBS) \
|
||||
$(GTK_LIBS) \
|
||||
$(RT_LIBS) \
|
||||
$(INTLLIBS)
|
||||
|
|
|
|||
108
plug-ins/metadata/exif-decode.c
Normal file
108
plug-ins/metadata/exif-decode.c
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
/* exif-decode.c - decodes exif data and converts it to XMP
|
||||
*
|
||||
* Copyright (C) 2004-2005, Róman Joost <romanofski@gimp.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
#include <libexif/exif-data.h>
|
||||
|
||||
#include "xmp-model.h"
|
||||
#include "xmp-schemas.h"
|
||||
|
||||
#include "exif-decode.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
gboolean xmp_merge_from_exifbuffer (XMPModel *xmp_model,
|
||||
gint32 image_ID,
|
||||
GError **error);
|
||||
static void exif_foreach_content_cb (ExifContent *content,
|
||||
XMPModel *xmp_model);
|
||||
static void exif_foreach_entry_cb (ExifEntry *entry,
|
||||
XMPModel *xmp_model);
|
||||
|
||||
/* public functions */
|
||||
|
||||
/**
|
||||
* xmp_merge_from_exifbuffer:
|
||||
* @xmp_model: pointer to the #XMPModel in which the results will be stored
|
||||
* @image_ID: id of the image where the exif data parasite is attached to
|
||||
* @error: return location for a #GErrror
|
||||
*
|
||||
* Load the Exif data, which is attached to the image as a parasite. The
|
||||
* parsed Exif data is merged into the XMP model.
|
||||
*
|
||||
* Return value: %TRUE on success, %FALSE if an error occured during
|
||||
* reading/writing
|
||||
*
|
||||
**/
|
||||
gboolean
|
||||
xmp_merge_from_exifbuffer (XMPModel *xmp_model,
|
||||
gint32 image_ID,
|
||||
GError **error)
|
||||
{
|
||||
ExifData *exif_data;
|
||||
GimpParasite *parasite = gimp_image_parasite_find (image_ID, "exif-data");
|
||||
|
||||
if (!parasite)
|
||||
return FALSE;
|
||||
|
||||
exif_data = exif_data_new_from_data (gimp_parasite_data (parasite),
|
||||
gimp_parasite_data_size (parasite));
|
||||
if (exif_data) {
|
||||
exif_data_foreach_content (exif_data,
|
||||
(void *) exif_foreach_content_cb,
|
||||
xmp_model);
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
exif_foreach_content_cb (ExifContent *content,
|
||||
XMPModel *xmp_model)
|
||||
{
|
||||
exif_content_foreach_entry (content,
|
||||
(void *) exif_foreach_entry_cb,
|
||||
xmp_model);
|
||||
}
|
||||
|
||||
static void
|
||||
exif_foreach_entry_cb (ExifEntry *entry,
|
||||
XMPModel *xmp_model)
|
||||
{
|
||||
char value[1024];
|
||||
|
||||
xmp_model_set_scalar_property (xmp_model,
|
||||
XMP_SCHEMA_EXIF,
|
||||
exif_tag_get_name (entry->tag),
|
||||
exif_entry_get_value (entry, value, sizeof (value)));
|
||||
}
|
||||
31
plug-ins/metadata/exif-decode.h
Normal file
31
plug-ins/metadata/exif-decode.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/* exif-decode.h - decode exif data and convert it to XMP
|
||||
*
|
||||
* Copyright (C) 2008, Róman Joost <romanofski@gimp.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef EXIF_DECODE_H
|
||||
#define EXIF_DECODE_H
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
gboolean xmp_merge_from_exifbuffer (XMPModel *xmp_model,
|
||||
gint32 image_ID,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* EXIF_DECODE_H */
|
||||
|
|
@ -69,9 +69,9 @@ typedef struct
|
|||
|
||||
static void
|
||||
value_edited (GtkCellRendererText *cell,
|
||||
const gchar *path_string,
|
||||
const gchar *new_text,
|
||||
gpointer data)
|
||||
const gchar *path_string,
|
||||
const gchar *new_text,
|
||||
gpointer data)
|
||||
{
|
||||
GtkTreeModel *model = data;
|
||||
GtkTreePath *path = gtk_tree_path_new_from_string (path_string);
|
||||
|
|
@ -85,8 +85,8 @@ value_edited (GtkCellRendererText *cell,
|
|||
/* FIXME: update value[] array */
|
||||
/* FIXME: check widget xref and update other widget if not NULL */
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
|
||||
COL_XMP_VALUE, new_text,
|
||||
-1);
|
||||
COL_XMP_VALUE, new_text,
|
||||
-1);
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ add_view_columns (GtkTreeView *treeview)
|
|||
g_object_set (renderer, "xalign", 0.0, NULL);
|
||||
|
||||
g_signal_connect (renderer, "edited",
|
||||
G_CALLBACK (value_edited), model);
|
||||
G_CALLBACK (value_edited), model);
|
||||
col_offset =
|
||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
||||
-1, _("Value"),
|
||||
|
|
@ -217,7 +217,7 @@ register_entry_xref (GtkWidget *entry,
|
|||
xref->property_name = property_name;
|
||||
xref->widget_list = g_slist_prepend (NULL, entry);
|
||||
g_signal_connect (GTK_ENTRY (entry), "changed",
|
||||
G_CALLBACK (entry_changed), xref);
|
||||
G_CALLBACK (entry_changed), xref);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -244,7 +244,7 @@ register_text_xref (GtkTextBuffer *text_buffer,
|
|||
xref->property_name = property_name;
|
||||
xref->widget_list = g_slist_prepend (NULL, text_buffer);
|
||||
g_signal_connect (GTK_TEXT_BUFFER (text_buffer), "changed",
|
||||
G_CALLBACK (text_changed), xref);
|
||||
G_CALLBACK (text_changed), xref);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -259,7 +259,7 @@ add_description_tab (GtkWidget *notebook)
|
|||
|
||||
frame = gimp_frame_new (_("Description"));
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame,
|
||||
gtk_label_new (_("Description")));
|
||||
gtk_label_new (_("Description")));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
|
||||
/* gtk_widget_show (frame); */
|
||||
|
||||
|
|
@ -272,21 +272,21 @@ add_description_tab (GtkWidget *notebook)
|
|||
entry = gtk_entry_new ();
|
||||
register_entry_xref (entry, XMP_SCHEMA_DUBLIN_CORE, "title");
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Image _title:"), 0.0, 0.5,
|
||||
entry, 1, FALSE);
|
||||
_("Image _title:"), 0.0, 0.5,
|
||||
entry, 1, FALSE);
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
register_entry_xref (entry, XMP_SCHEMA_DUBLIN_CORE, "creator");
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
||||
_("_Author:"), 0.0, 0.5,
|
||||
entry, 1, FALSE);
|
||||
_("_Author:"), 0.0, 0.5,
|
||||
entry, 1, FALSE);
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_SHADOW_IN);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
text_view = gtk_text_view_new ();
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
|
||||
gtk_text_buffer_set_text (text_buffer,
|
||||
|
|
@ -297,28 +297,28 @@ add_description_tab (GtkWidget *notebook)
|
|||
register_text_xref (text_buffer, XMP_SCHEMA_DUBLIN_CORE, "description");
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
|
||||
_("_Description:"), 0.0, 0.5,
|
||||
scrolled_window, 1, FALSE);
|
||||
_("_Description:"), 0.0, 0.5,
|
||||
scrolled_window, 1, FALSE);
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
register_entry_xref (entry, XMP_SCHEMA_PHOTOSHOP, "CaptionWriter");
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
|
||||
_("Description _writer:"), 0.0, 0.5,
|
||||
entry, 1, FALSE);
|
||||
_("Description _writer:"), 0.0, 0.5,
|
||||
entry, 1, FALSE);
|
||||
|
||||
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_SHADOW_IN);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
text_view = gtk_text_view_new ();
|
||||
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
|
||||
register_text_xref (text_buffer, XMP_SCHEMA_PDF, "Keywords");
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 4,
|
||||
_("_Keywords:"), 0.0, 0.5,
|
||||
scrolled_window, 1, FALSE);
|
||||
_("_Keywords:"), 0.0, 0.5,
|
||||
scrolled_window, 1, FALSE);
|
||||
|
||||
gtk_widget_show_all (frame);
|
||||
}
|
||||
|
|
@ -331,7 +331,7 @@ add_copyright_tab (GtkWidget *notebook)
|
|||
/* FIXME: add entries, cross-link with XMP model */
|
||||
label = gtk_label_new (_("Empty"));
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label,
|
||||
gtk_label_new (_("Copyright")));
|
||||
gtk_label_new (_("Copyright")));
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ add_origin_tab (GtkWidget *notebook)
|
|||
/* FIXME: add entries, cross-link with XMP model */
|
||||
label = gtk_label_new (_("Empty"));
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label,
|
||||
gtk_label_new (_("Origin")));
|
||||
gtk_label_new (_("Origin")));
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
|
|
@ -355,7 +355,7 @@ add_camera1_tab (GtkWidget *notebook)
|
|||
/* FIXME: add entries, cross-link with XMP model */
|
||||
label = gtk_label_new (_("Empty"));
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label,
|
||||
gtk_label_new (_("Camera 1")));
|
||||
gtk_label_new (_("Camera 1")));
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
|
|
@ -367,7 +367,7 @@ add_camera2_tab (GtkWidget *notebook)
|
|||
/* FIXME: add entries, cross-link with XMP model */
|
||||
label = gtk_label_new (_("Empty"));
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), label,
|
||||
gtk_label_new (_("Camera 2")));
|
||||
gtk_label_new (_("Camera 2")));
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
|
|
@ -382,13 +382,13 @@ add_thumbnail_tab (GtkWidget *notebook)
|
|||
(GtkIconSize) -1, "thumbnail");
|
||||
image = gtk_image_new_from_pixbuf (default_thumb);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), image,
|
||||
gtk_label_new (_("Thumbnail")));
|
||||
gtk_label_new (_("Thumbnail")));
|
||||
gtk_widget_show (image);
|
||||
}
|
||||
|
||||
static void
|
||||
add_advanced_tab (GtkWidget *notebook,
|
||||
GtkTreeModel *model)
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
GtkWidget *sw;
|
||||
GtkWidget *treeview;
|
||||
|
|
@ -396,12 +396,12 @@ add_advanced_tab (GtkWidget *notebook,
|
|||
/* Advanced tab */
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_SHADOW_ETCHED_IN);
|
||||
GTK_SHADOW_ETCHED_IN);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), sw,
|
||||
gtk_label_new (_("Advanced")));
|
||||
gtk_label_new (_("Advanced")));
|
||||
|
||||
/* create tree view - model will be unref'ed in xmp_model_free() */
|
||||
treeview = gtk_tree_view_new_with_model (model);
|
||||
|
|
@ -413,7 +413,7 @@ add_advanced_tab (GtkWidget *notebook,
|
|||
|
||||
/* expand all rows after the treeview widget has been realized */
|
||||
g_signal_connect (treeview, "realize",
|
||||
G_CALLBACK (gtk_tree_view_expand_all), NULL);
|
||||
G_CALLBACK (gtk_tree_view_expand_all), NULL);
|
||||
gtk_widget_show (treeview);
|
||||
gtk_widget_show (sw);
|
||||
}
|
||||
|
|
@ -590,7 +590,7 @@ file_export_dialog (GtkWidget *parent,
|
|||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
|
||||
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
|
||||
|
||||
NULL);
|
||||
|
||||
|
|
@ -683,7 +683,7 @@ metadata_dialog (gint32 image_ID,
|
|||
gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (notebook), 12);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (mgui.dlg)->vbox), notebook,
|
||||
TRUE, TRUE, 0);
|
||||
TRUE, TRUE, 0);
|
||||
gtk_widget_show (notebook);
|
||||
|
||||
mgui.xmp_model = xmp_model;
|
||||
|
|
|
|||
|
|
@ -23,14 +23,16 @@
|
|||
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
#include <libexif/exif-data.h>
|
||||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include "metadata.h"
|
||||
#include "xmp-encode.h"
|
||||
|
||||
/* FIXME: uncomment when these are working
|
||||
#include "interface.h"
|
||||
#include "exif-decode.h"
|
||||
/* FIXME: uncomment when these are working
|
||||
#include "exif-encode.h"
|
||||
#include "iptc-decode.h"
|
||||
*/
|
||||
|
|
@ -65,14 +67,12 @@ MAIN ()
|
|||
static void
|
||||
query (void)
|
||||
{
|
||||
/* FIXME: uncomment when these are working
|
||||
static const GimpParamDef editor_args[] =
|
||||
{
|
||||
{ GIMP_PDB_INT32, "run-mode", "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" },
|
||||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable (unused)" }
|
||||
};
|
||||
*/
|
||||
|
||||
static const GimpParamDef decode_xmp_args[] =
|
||||
{
|
||||
|
|
@ -89,7 +89,6 @@ query (void)
|
|||
{ GIMP_PDB_STRING, "xmp", "XMP packet" }
|
||||
};
|
||||
|
||||
/* FIXME: uncomment when these are working
|
||||
static const GimpParamDef decode_exif_args[] =
|
||||
{
|
||||
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
||||
|
|
@ -97,6 +96,7 @@ query (void)
|
|||
{ GIMP_PDB_INT8ARRAY, "exif", "EXIF block" }
|
||||
};
|
||||
|
||||
/* FIXME: uncomment when these are working
|
||||
static const GimpParamDef encode_exif_args[] =
|
||||
{
|
||||
{ GIMP_PDB_IMAGE, "image", "Input image" }
|
||||
|
|
@ -179,17 +179,16 @@ query (void)
|
|||
{ GIMP_PDB_INT32, "overwrite", "Overwrite existing file: { FALSE (0), TRUE (1) }" }
|
||||
};
|
||||
|
||||
/* FIXME: uncomment when these are working
|
||||
gimp_install_procedure (EDITOR_PROC,
|
||||
N_("View and edit metadata (EXIF, IPTC, XMP)"),
|
||||
N_("View and edit metadata (EXIF, IPTC, XMP)"),
|
||||
"View and edit metadata information attached to the "
|
||||
"current image. This can include EXIF, IPTC and/or "
|
||||
"XMP information. Some or all of this metadata "
|
||||
"will be saved in the file, depending on the output "
|
||||
"file format.",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2004-2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2004-2005",
|
||||
N_("Propert_ies"),
|
||||
"RGB*, INDEXED*, GRAY*",
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -197,18 +196,17 @@ query (void)
|
|||
editor_args, NULL);
|
||||
|
||||
gimp_plugin_menu_register (EDITOR_PROC, "<Image>/File/Info");
|
||||
gimp_plugin_icon_register (EDITOR_PROC, GIMP_ICON_TYPE_STOCK_ID,
|
||||
*/
|
||||
// XXX gimp_plugin_icon_register (EDITOR_PROC, GIMP_ICON_TYPE_STOCK_ID,
|
||||
|
||||
gimp_install_procedure (DECODE_XMP_PROC,
|
||||
"Decode an XMP packet",
|
||||
"Decode an XMP packet",
|
||||
"Parse an XMP packet and merge the results with "
|
||||
"any metadata already attached to the image. This "
|
||||
"should be used when an XMP packet is read from an "
|
||||
"image file.",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -216,13 +214,13 @@ query (void)
|
|||
decode_xmp_args, NULL);
|
||||
|
||||
gimp_install_procedure (ENCODE_XMP_PROC,
|
||||
"Encode metadata into an XMP packet",
|
||||
"Encode metadata into an XMP packet",
|
||||
"Generate an XMP packet from the metadata "
|
||||
"information attached to the image. The new XMP "
|
||||
"packet can then be saved into a file.",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Róman Joost <romanofski@gimp.org>",
|
||||
"Róman Joost <romanofski@gimp.org>",
|
||||
"2008",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -230,30 +228,30 @@ query (void)
|
|||
G_N_ELEMENTS (encode_xmp_return_vals),
|
||||
encode_xmp_args, encode_xmp_return_vals);
|
||||
|
||||
/* FIXME: uncomment when these are working
|
||||
gimp_install_procedure (DECODE_EXIF_PROC,
|
||||
"Decode an EXIF block",
|
||||
"Decode an EXIF block",
|
||||
"Parse an EXIF block and merge the results with "
|
||||
"any metadata already attached to the image. This "
|
||||
"should be used when an EXIF block is read from an "
|
||||
"image file.",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
G_N_ELEMENTS (decode_exif_args), 0,
|
||||
decode_exif_args, NULL);
|
||||
|
||||
/* FIXME: uncomment when these are working
|
||||
gimp_install_procedure (ENCODE_EXIF_PROC,
|
||||
"Encode metadata into an EXIF block",
|
||||
"Encode metadata into an EXIF block",
|
||||
"Generate an EXIF block from the metadata "
|
||||
"information attached to the image. The new EXIF "
|
||||
"block can then be saved into a file.",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -263,12 +261,12 @@ query (void)
|
|||
*/
|
||||
|
||||
gimp_install_procedure (GET_PROC,
|
||||
"Retrieve the values of an XMP property",
|
||||
"Retrieve the values of an XMP property",
|
||||
"Retrieve the list of values associated with "
|
||||
"an XMP property.",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -277,13 +275,13 @@ query (void)
|
|||
get_args, get_return_vals);
|
||||
|
||||
gimp_install_procedure (SET_PROC,
|
||||
"Set the values of an XMP property",
|
||||
"Set the values of an XMP property",
|
||||
"Set the list of values associated with "
|
||||
"an XMP property. If a property with the same "
|
||||
"name already exists, it will be replaced.",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -291,15 +289,15 @@ query (void)
|
|||
set_args, NULL);
|
||||
|
||||
gimp_install_procedure (GET_SIMPLE_PROC,
|
||||
"Retrieve the value of an XMP property",
|
||||
"Retrieve the value of an XMP property",
|
||||
"Retrieve value associated with a scalar XMP "
|
||||
"property. This can only be done for simple "
|
||||
"property types such as text or integers. "
|
||||
"Structured types must be retrieved with "
|
||||
"plug_in_metadata_get().",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -308,14 +306,14 @@ query (void)
|
|||
get_simple_args, get_simple_return_vals);
|
||||
|
||||
gimp_install_procedure (SET_SIMPLE_PROC,
|
||||
"Set the value of an XMP property",
|
||||
"Set the value of an XMP property",
|
||||
"Set the value of a scalar XMP property. This "
|
||||
"can only be done for simple property types such "
|
||||
"as text or integers. Structured types need to "
|
||||
"be set with plug_in_metadata_set().",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -323,14 +321,14 @@ query (void)
|
|||
set_simple_args, NULL);
|
||||
|
||||
gimp_install_procedure (IMPORT_PROC,
|
||||
"Import XMP from a file into the current image",
|
||||
"Import XMP from a file into the current image",
|
||||
"Load an XMP packet from a file and import it into "
|
||||
"the current image. This can be used to add a "
|
||||
"license statement or some other predefined "
|
||||
"metadata to an image",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -338,16 +336,16 @@ query (void)
|
|||
import_args, NULL);
|
||||
|
||||
gimp_install_procedure (EXPORT_PROC,
|
||||
"Export XMP from the current image to a file",
|
||||
"Export XMP from the current image to a file",
|
||||
"Export the metadata associated with the current "
|
||||
"image into a file. The metadata will be saved as "
|
||||
"an XMP packet. If overwrite is TRUE, then any "
|
||||
"existing file will be overwritten without warning. "
|
||||
"If overwrite is FALSE, then an error will occur if "
|
||||
"the file already exists.",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"Raphaël Quinet <raphael@gimp.org>",
|
||||
"2005",
|
||||
NULL,
|
||||
NULL,
|
||||
GIMP_PLUGIN,
|
||||
|
|
@ -396,9 +394,9 @@ run (const gchar *name,
|
|||
+ METADATA_MARKER_LEN,
|
||||
gimp_parasite_data_size (parasite)
|
||||
- METADATA_MARKER_LEN,
|
||||
FALSE, &error))
|
||||
TRUE, &error))
|
||||
{
|
||||
g_printerr ("Metadata parasite seems to be corrupt");
|
||||
g_printerr ("\nMetadata parasite seems to be corrupt");
|
||||
/* continue anyway, we will attach a clean parasite later */
|
||||
}
|
||||
gimp_parasite_free (parasite);
|
||||
|
|
@ -432,11 +430,26 @@ run (const gchar *name,
|
|||
if (! xmp_model_parse_buffer (xmp_model, buffer, strlen (buffer),
|
||||
FALSE, &error))
|
||||
status = GIMP_PDB_EXECUTION_ERROR;
|
||||
|
||||
}
|
||||
else if (! strcmp (name, ENCODE_XMP_PROC))
|
||||
{
|
||||
/* done below together with the parasite */
|
||||
}
|
||||
else if (! strcmp (name, DECODE_EXIF_PROC))
|
||||
{
|
||||
#ifdef HAVE_EXIF
|
||||
GError *error = NULL;
|
||||
|
||||
if (! xmp_merge_from_exifbuffer (xmp_model,
|
||||
image_ID,
|
||||
&error))
|
||||
{
|
||||
status = GIMP_PDB_EXECUTION_ERROR;
|
||||
g_printerr ("\nExif to XMP merge failed.\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (! strcmp (name, GET_PROC))
|
||||
{
|
||||
g_printerr ("Not implemented yet (GET_PROC)\n"); /* FIXME */
|
||||
|
|
@ -509,7 +522,6 @@ run (const gchar *name,
|
|||
}
|
||||
else if (! strcmp (name, EDITOR_PROC))
|
||||
{
|
||||
/* FIXME: uncomment when these are working
|
||||
GimpRunMode run_mode;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
|
@ -519,7 +531,6 @@ run (const gchar *name,
|
|||
status = GIMP_PDB_CANCEL;
|
||||
}
|
||||
|
||||
*/
|
||||
g_printerr ("Not implemented yet (EDITOR_PROC)\n");
|
||||
status = GIMP_PDB_EXECUTION_ERROR;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue