plug-ins: port various plug-ins to gimp_load_procedure_new2().
This commit is contained in:
parent
af644b1950
commit
4a3fd7423a
17 changed files with 622 additions and 700 deletions
|
|
@ -59,33 +59,35 @@ struct _FarbfeldClass
|
|||
GType farbfeld_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
static GList * farbfeld_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * farbfeld_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * farbfeld_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * farbfeld_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * farbfeld_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * farbfeld_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * farbfeld_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * farbfeld_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GObject *config,
|
||||
GimpRunMode run_mode,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GError **error);
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GObject *config,
|
||||
GimpRunMode run_mode,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Farbfeld, farbfeld, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -128,9 +130,9 @@ farbfeld_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
farbfeld_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
farbfeld_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure,
|
||||
N_("Farbfeld"));
|
||||
|
|
@ -180,22 +182,20 @@ farbfeld_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
farbfeld_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
farbfeld_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpProcedureConfig *config;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
GError *error = NULL;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
GError *error = NULL;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
config = gimp_procedure_create_config (procedure);
|
||||
gimp_procedure_config_begin_run (config, NULL, run_mode, args);
|
||||
|
||||
image = load_image (file, G_OBJECT (config), run_mode, &error);
|
||||
|
||||
if (! image)
|
||||
|
|
@ -203,9 +203,6 @@ farbfeld_load (GimpProcedure *procedure,
|
|||
GIMP_PDB_EXECUTION_ERROR,
|
||||
error);
|
||||
|
||||
gimp_procedure_config_end_run (config, GIMP_PDB_SUCCESS);
|
||||
g_object_unref (config);
|
||||
|
||||
return_vals = gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_SUCCESS,
|
||||
NULL);
|
||||
|
|
|
|||
|
|
@ -74,33 +74,35 @@ struct _GoatClass
|
|||
|
||||
GType goat_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * goat_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * goat_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * goat_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * goat_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * goat_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * goat_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * goat_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * goat_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpImage * load_image (GFile *file,
|
||||
const gchar *gegl_op,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
const gchar *gegl_op,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GError **error);
|
||||
static GimpImage * load_image (GFile *file,
|
||||
const gchar *gegl_op,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
const gchar *gegl_op,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Goat, goat, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -192,10 +194,10 @@ goat_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! g_strcmp0 (name, format->load_proc))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
goat_load,
|
||||
(gpointer) format, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
goat_load,
|
||||
(gpointer) format, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, format->file_type);
|
||||
|
||||
|
|
@ -238,11 +240,13 @@ goat_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
goat_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
goat_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
const FileFormat *format = run_data;
|
||||
GimpValueArray *return_vals;
|
||||
|
|
|
|||
|
|
@ -102,24 +102,26 @@ struct _GifClass
|
|||
|
||||
GType gif_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * gif_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * gif_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * gif_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * gif_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * gif_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * gif_load_thumb (GimpProcedure *procedure,
|
||||
GFile *file,
|
||||
gint size,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * gif_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * gif_load_thumb (GimpProcedure *procedure,
|
||||
GFile *file,
|
||||
gint size,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpImage * load_image (GFile *file,
|
||||
gboolean thumbnail,
|
||||
GError **error);
|
||||
static GimpImage * load_image (GFile *file,
|
||||
gboolean thumbnail,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Gif, gif, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -169,16 +171,15 @@ gif_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
gif_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
gif_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("GIF image"));
|
||||
|
||||
gimp_procedure_set_documentation (procedure,
|
||||
"Loads files of Compuserve GIF "
|
||||
"file format",
|
||||
"FIXME: write help for gif_load",
|
||||
"file format", NULL,
|
||||
name);
|
||||
gimp_procedure_set_attribution (procedure,
|
||||
"Spencer Kimball, Peter Mattis, "
|
||||
|
|
@ -220,11 +221,13 @@ gif_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
|
||||
static GimpValueArray *
|
||||
gif_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
gif_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
@ -261,6 +264,7 @@ gif_load (GimpProcedure *procedure,
|
|||
GIMP_PDB_SUCCESS,
|
||||
NULL);
|
||||
|
||||
*flags = GIMP_METADATA_LOAD_ALL;
|
||||
GIMP_VALUES_SET_IMAGE (return_vals, 1, image);
|
||||
|
||||
return return_vals;
|
||||
|
|
|
|||
|
|
@ -113,31 +113,33 @@ struct _Jp2Class
|
|||
|
||||
GType jp2_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * jp2_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * jp2_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * jp2_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * jp2_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * jp2_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * jp2_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpImage * load_image (GimpProcedure *procedure,
|
||||
GObject *config,
|
||||
GFile *file,
|
||||
OPJ_CODEC_FORMAT format,
|
||||
OPJ_COLOR_SPACE color_space,
|
||||
gboolean interactive,
|
||||
gboolean *profile_loaded,
|
||||
GError **error);
|
||||
static GimpImage * load_image (GimpProcedure *procedure,
|
||||
GObject *config,
|
||||
GFile *file,
|
||||
OPJ_CODEC_FORMAT format,
|
||||
OPJ_COLOR_SPACE color_space,
|
||||
gboolean interactive,
|
||||
gboolean *profile_loaded,
|
||||
GError **error);
|
||||
|
||||
static OPJ_COLOR_SPACE open_dialog (GimpProcedure *procedure,
|
||||
GObject *config,
|
||||
GFile *file,
|
||||
OPJ_CODEC_FORMAT format,
|
||||
gint num_components,
|
||||
GError **error);
|
||||
static OPJ_COLOR_SPACE open_dialog (GimpProcedure *procedure,
|
||||
GObject *config,
|
||||
GFile *file,
|
||||
OPJ_CODEC_FORMAT format,
|
||||
gint num_components,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Jp2, jp2, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -180,9 +182,9 @@ jp2_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_JP2_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
jp2_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
jp2_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("JPEG 2000 image"));
|
||||
gimp_file_procedure_set_format_name (GIMP_FILE_PROCEDURE (procedure),
|
||||
|
|
@ -214,9 +216,9 @@ jp2_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
else if (! strcmp (name, LOAD_J2K_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
jp2_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
jp2_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("JPEG 2000 codestream"));
|
||||
gimp_file_procedure_set_format_name (GIMP_FILE_PROCEDURE (procedure),
|
||||
|
|
@ -255,27 +257,24 @@ jp2_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
jp2_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
jp2_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpProcedureConfig *config;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image = NULL;
|
||||
OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_UNKNOWN;
|
||||
gboolean interactive;
|
||||
GimpMetadata *metadata;
|
||||
gboolean profile_loaded = FALSE;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
GError *error = NULL;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image = NULL;
|
||||
OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_UNKNOWN;
|
||||
gboolean interactive;
|
||||
gboolean profile_loaded = FALSE;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
GError *error = NULL;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
config = gimp_procedure_create_config (procedure);
|
||||
gimp_procedure_config_begin_run (config, image, run_mode, args);
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case GIMP_RUN_INTERACTIVE:
|
||||
|
|
@ -332,30 +331,11 @@ jp2_load (GimpProcedure *procedure,
|
|||
{
|
||||
status = error ? GIMP_PDB_EXECUTION_ERROR : GIMP_PDB_CANCEL;
|
||||
|
||||
gimp_procedure_config_end_run (config, status);
|
||||
g_object_unref (config);
|
||||
|
||||
return gimp_procedure_new_return_values (procedure, status, error);
|
||||
}
|
||||
|
||||
metadata = gimp_image_metadata_load_prepare (image, "image/jp2",
|
||||
file, NULL);
|
||||
|
||||
if (metadata)
|
||||
{
|
||||
GimpMetadataLoadFlags flags = GIMP_METADATA_LOAD_ALL;
|
||||
|
||||
if (profile_loaded)
|
||||
flags &= ~GIMP_METADATA_LOAD_COLORSPACE;
|
||||
|
||||
gimp_image_metadata_load_finish (image, "image/jp2",
|
||||
metadata, flags);
|
||||
|
||||
g_object_unref (metadata);
|
||||
}
|
||||
|
||||
gimp_procedure_config_end_run (config, status);
|
||||
g_object_unref (config);
|
||||
if (profile_loaded)
|
||||
*flags &= ~GIMP_METADATA_LOAD_COLORSPACE;
|
||||
|
||||
return_vals = gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_SUCCESS,
|
||||
|
|
|
|||
|
|
@ -55,43 +55,45 @@ struct _JpegXLClass
|
|||
|
||||
GType jpegxl_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList *jpegxl_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure *jpegxl_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList *jpegxl_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure *jpegxl_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray *jpegxl_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray *jpegxl_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray *jpegxl_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray *jpegxl_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static void create_cmyk_layer (GimpImage *image,
|
||||
GimpLayer *layer,
|
||||
const Babl *space,
|
||||
const Babl *type,
|
||||
gpointer picture_buffer,
|
||||
gpointer key_buffer,
|
||||
gint bit_depth,
|
||||
gboolean has_alpha);
|
||||
static void extract_cmyk (GeglBuffer *buffer,
|
||||
gpointer *cmy_data,
|
||||
gpointer *key_data,
|
||||
gpointer *alpha_data,
|
||||
const Babl *type,
|
||||
const Babl *space,
|
||||
gint width,
|
||||
gint height,
|
||||
gint bit_depth,
|
||||
gboolean has_alpha);
|
||||
static void create_cmyk_layer (GimpImage *image,
|
||||
GimpLayer *layer,
|
||||
const Babl *space,
|
||||
const Babl *type,
|
||||
gpointer picture_buffer,
|
||||
gpointer key_buffer,
|
||||
gint bit_depth,
|
||||
gboolean has_alpha);
|
||||
static void extract_cmyk (GeglBuffer *buffer,
|
||||
gpointer *cmy_data,
|
||||
gpointer *key_data,
|
||||
gpointer *alpha_data,
|
||||
const Babl *type,
|
||||
const Babl *space,
|
||||
gint width,
|
||||
gint height,
|
||||
gint bit_depth,
|
||||
gboolean has_alpha);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (JpegXL, jpegxl, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -133,9 +135,9 @@ jpegxl_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
jpegxl_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
jpegxl_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("JPEG XL image"));
|
||||
|
||||
|
|
@ -1138,37 +1140,27 @@ load_image (GFile *file,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
jpegxl_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
jpegxl_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
GError *error = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
switch (run_mode)
|
||||
{
|
||||
case GIMP_RUN_INTERACTIVE:
|
||||
case GIMP_RUN_WITH_LAST_VALS:
|
||||
gimp_ui_init (PLUG_IN_BINARY);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
image = load_image (file, run_mode, &error);
|
||||
|
||||
if (! image)
|
||||
{
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_EXECUTION_ERROR,
|
||||
error);
|
||||
}
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_EXECUTION_ERROR,
|
||||
error);
|
||||
|
||||
return_vals = gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_SUCCESS,
|
||||
NULL);
|
||||
|
|
|
|||
|
|
@ -580,36 +580,38 @@ struct _PspClass
|
|||
|
||||
GType psp_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * psp_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * psp_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * psp_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * psp_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * psp_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psp_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psp_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psp_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GObject *config,
|
||||
GError **error);
|
||||
static gboolean save_dialog (GimpProcedure *procedure,
|
||||
GObject *config,
|
||||
GimpImage *image);
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GObject *config,
|
||||
GError **error);
|
||||
static gboolean save_dialog (GimpProcedure *procedure,
|
||||
GObject *config,
|
||||
GimpImage *image);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Psp, psp, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -658,9 +660,9 @@ psp_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
psp_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
psp_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("Paint Shop Pro image"));
|
||||
|
||||
|
|
@ -725,11 +727,13 @@ psp_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
psp_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
psp_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
|
|||
|
|
@ -61,33 +61,35 @@ struct _QoiClass
|
|||
GType qoi_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
static GList * qoi_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * qoi_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * qoi_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * qoi_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * qoi_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * qoi_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * qoi_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * qoi_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GObject *config,
|
||||
GimpRunMode run_mode,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GError **error);
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GObject *config,
|
||||
GimpRunMode run_mode,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GError **error);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Qoi, qoi, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -130,9 +132,9 @@ qoi_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
qoi_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
qoi_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure,
|
||||
N_("Quite OK Image"));
|
||||
|
|
@ -184,22 +186,20 @@ qoi_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
qoi_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
qoi_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpProcedureConfig *config;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
GError *error = NULL;
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
GError *error = NULL;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
config = gimp_procedure_create_config (procedure);
|
||||
gimp_procedure_config_begin_run (config, NULL, run_mode, args);
|
||||
|
||||
image = load_image (file, G_OBJECT (config), run_mode, &error);
|
||||
|
||||
if (! image)
|
||||
|
|
@ -207,9 +207,6 @@ qoi_load (GimpProcedure *procedure,
|
|||
GIMP_PDB_EXECUTION_ERROR,
|
||||
error);
|
||||
|
||||
gimp_procedure_config_end_run (config, GIMP_PDB_SUCCESS);
|
||||
g_object_unref (config);
|
||||
|
||||
return_vals = gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_SUCCESS,
|
||||
NULL);
|
||||
|
|
|
|||
|
|
@ -170,40 +170,42 @@ struct _TgaClass
|
|||
|
||||
GType tga_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * tga_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * tga_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * tga_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * tga_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * tga_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * tga_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * tga_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * tga_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GObject *config,
|
||||
GError **error);
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GError **error);
|
||||
static gboolean save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GObject *config,
|
||||
GError **error);
|
||||
|
||||
static gboolean save_dialog (GimpImage *image,
|
||||
GimpProcedure *procedure,
|
||||
GObject *config);
|
||||
static gboolean save_dialog (GimpImage *image,
|
||||
GimpProcedure *procedure,
|
||||
GObject *config);
|
||||
|
||||
static GimpImage * ReadImage (FILE *fp,
|
||||
tga_info *info,
|
||||
GFile *file);
|
||||
static GimpImage * ReadImage (FILE *fp,
|
||||
tga_info *info,
|
||||
GFile *file);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Tga, tga, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -254,9 +256,9 @@ tga_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
tga_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
tga_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("TarGA image"));
|
||||
|
||||
|
|
@ -319,11 +321,13 @@ tga_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
tga_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
tga_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
|
|||
|
|
@ -66,32 +66,34 @@ struct _DdsClass
|
|||
|
||||
GType dds_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * dds_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * dds_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * dds_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * dds_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * dds_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * dds_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * dds_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * dds_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
#if 0
|
||||
static GimpValueArray * dds_decode (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * dds_decode (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -140,9 +142,9 @@ dds_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
dds_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
dds_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("DDS image"));
|
||||
|
||||
|
|
@ -387,13 +389,14 @@ dds_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
dds_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
dds_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpProcedureConfig *config;
|
||||
GimpValueArray *return_vals;
|
||||
GimpPDBStatusType status;
|
||||
GimpImage *image;
|
||||
|
|
@ -401,15 +404,9 @@ dds_load (GimpProcedure *procedure,
|
|||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
config = gimp_procedure_create_config (procedure);
|
||||
gimp_procedure_config_begin_run (config, NULL, run_mode, args);
|
||||
|
||||
status = read_dds (file, &image, run_mode == GIMP_RUN_INTERACTIVE,
|
||||
procedure, G_OBJECT (config), &error);
|
||||
|
||||
gimp_procedure_config_end_run (config, status);
|
||||
g_object_unref (config);
|
||||
|
||||
if (status != GIMP_PDB_SUCCESS)
|
||||
return gimp_procedure_new_return_values (procedure, status, error);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,19 +65,23 @@ struct _IcoClass
|
|||
|
||||
GType ico_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * ico_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * ico_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * ico_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * ico_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * ico_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * ani_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
static GimpValueArray * ico_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * ani_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * ico_load_thumb (GimpProcedure *procedure,
|
||||
GFile *file,
|
||||
|
|
@ -164,9 +168,9 @@ ico_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
ico_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
ico_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("Microsoft Windows icon"));
|
||||
gimp_procedure_set_icon_name (procedure, GIMP_ICON_BRUSH);
|
||||
|
|
@ -192,9 +196,9 @@ ico_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
else if (! strcmp (name, LOAD_CUR_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
ico_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
ico_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("Microsoft Windows cursor"));
|
||||
gimp_procedure_set_icon_name (procedure, GIMP_ICON_BRUSH);
|
||||
|
|
@ -222,9 +226,9 @@ ico_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
else if (! strcmp (name, LOAD_ANI_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
ani_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
ani_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("Microsoft Windows animated cursor"));
|
||||
gimp_procedure_set_icon_name (procedure, GIMP_ICON_BRUSH);
|
||||
|
|
@ -426,11 +430,13 @@ ico_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
ico_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
ico_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
@ -455,11 +461,13 @@ ico_load (GimpProcedure *procedure,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
ani_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
ani_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
|
|||
|
|
@ -54,29 +54,31 @@ struct _JpegClass
|
|||
|
||||
GType jpeg_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * jpeg_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * jpeg_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * jpeg_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * jpeg_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * jpeg_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * jpeg_load_thumb (GimpProcedure *procedure,
|
||||
GFile *file,
|
||||
gint size,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * jpeg_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * jpeg_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * jpeg_load_thumb (GimpProcedure *procedure,
|
||||
GFile *file,
|
||||
gint size,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * jpeg_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Jpeg, jpeg, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -127,7 +129,7 @@ jpeg_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
jpeg_load, NULL, NULL);
|
||||
|
||||
|
|
@ -315,11 +317,13 @@ jpeg_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
jpeg_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
jpeg_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
@ -348,23 +352,8 @@ jpeg_load (GimpProcedure *procedure,
|
|||
|
||||
if (image)
|
||||
{
|
||||
GimpMetadata *metadata;
|
||||
|
||||
metadata = gimp_image_metadata_load_prepare (image, "image/jpeg",
|
||||
file, NULL);
|
||||
|
||||
if (metadata)
|
||||
{
|
||||
GimpMetadataLoadFlags flags = GIMP_METADATA_LOAD_ALL;
|
||||
|
||||
if (resolution_loaded)
|
||||
flags &= ~GIMP_METADATA_LOAD_RESOLUTION;
|
||||
|
||||
gimp_image_metadata_load_finish (image, "image/jpeg",
|
||||
metadata, flags);
|
||||
|
||||
g_object_unref (metadata);
|
||||
}
|
||||
if (resolution_loaded)
|
||||
*flags &= ~GIMP_METADATA_LOAD_RESOLUTION;
|
||||
}
|
||||
|
||||
if (! image)
|
||||
|
|
|
|||
|
|
@ -52,34 +52,38 @@ struct _PsdClass
|
|||
|
||||
GType psd_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * psd_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * psd_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * psd_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * psd_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * psd_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psd_load_thumb (GimpProcedure *procedure,
|
||||
GFile *file,
|
||||
gint size,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psd_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psd_load_metadata (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
static GimpValueArray * psd_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psd_load_thumb (GimpProcedure *procedure,
|
||||
GFile *file,
|
||||
gint size,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psd_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * psd_load_metadata (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Psd, psd, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -125,9 +129,9 @@ psd_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
psd_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
psd_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("Photoshop image"));
|
||||
|
||||
|
|
@ -154,9 +158,9 @@ psd_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
else if (! strcmp (name, LOAD_MERGED_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
psd_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
psd_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("Photoshop image (merged)"));
|
||||
|
||||
|
|
@ -267,9 +271,9 @@ psd_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
else if (! strcmp (name, LOAD_METADATA_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
psd_load_metadata, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
psd_load_metadata, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_documentation (procedure,
|
||||
"Loads Photoshop-format metadata "
|
||||
|
|
@ -310,17 +314,18 @@ psd_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
psd_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
psd_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
gboolean resolution_loaded = FALSE;
|
||||
gboolean profile_loaded = FALSE;
|
||||
GimpImage *image;
|
||||
GimpMetadata *metadata;
|
||||
GimpParasite *parasite = NULL;
|
||||
GError *error = NULL;
|
||||
PSDSupport unsupported_features;
|
||||
|
|
@ -365,23 +370,11 @@ psd_load (GimpProcedure *procedure,
|
|||
gimp_parasite_free (parasite);
|
||||
}
|
||||
|
||||
metadata = gimp_image_metadata_load_prepare (image, "image/x-psd",
|
||||
file, NULL);
|
||||
if (metadata)
|
||||
{
|
||||
GimpMetadataLoadFlags flags = GIMP_METADATA_LOAD_ALL;
|
||||
if (resolution_loaded)
|
||||
*flags &= ~GIMP_METADATA_LOAD_RESOLUTION;
|
||||
|
||||
if (resolution_loaded)
|
||||
flags &= ~GIMP_METADATA_LOAD_RESOLUTION;
|
||||
|
||||
if (profile_loaded)
|
||||
flags &= ~GIMP_METADATA_LOAD_COLORSPACE;
|
||||
|
||||
gimp_image_metadata_load_finish (image, "image/x-psd",
|
||||
metadata, flags);
|
||||
|
||||
g_object_unref (metadata);
|
||||
}
|
||||
if (profile_loaded)
|
||||
*flags &= ~GIMP_METADATA_LOAD_COLORSPACE;
|
||||
|
||||
return_vals = gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_SUCCESS,
|
||||
|
|
@ -494,11 +487,13 @@ psd_save (GimpProcedure *procedure,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
psd_load_metadata (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
psd_load_metadata (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
@ -511,22 +506,12 @@ psd_load_metadata (GimpProcedure *procedure,
|
|||
gegl_init (NULL, NULL);
|
||||
|
||||
/* Retrieve image */
|
||||
if (gimp_value_array_length (args) > 1)
|
||||
{
|
||||
data_length = g_value_get_int (gimp_value_array_index (args, 0));
|
||||
image = g_value_get_object (gimp_value_array_index (args, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_EXECUTION_ERROR,
|
||||
error);
|
||||
}
|
||||
|
||||
if (gimp_value_array_length (args) > 2)
|
||||
is_layer = g_value_get_boolean (gimp_value_array_index (args, 2));
|
||||
if (gimp_value_array_length (args) > 3)
|
||||
is_cmyk = g_value_get_boolean (gimp_value_array_index (args, 3));
|
||||
g_object_get (config,
|
||||
"image", &image,
|
||||
"size", &data_length,
|
||||
"metadata-type", &is_layer,
|
||||
"cmyk", &is_cmyk,
|
||||
NULL);
|
||||
|
||||
image = load_image_metadata (file, data_length, image, is_layer, is_cmyk,
|
||||
&unsupported_features, &error);
|
||||
|
|
|
|||
|
|
@ -65,36 +65,38 @@ struct _SgiClass
|
|||
|
||||
GType sgi_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * sgi_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * sgi_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * sgi_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * sgi_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * sgi_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * sgi_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * sgi_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * sgi_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GError **error);
|
||||
static gint save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GObject *config,
|
||||
GError **error);
|
||||
static GimpImage * load_image (GFile *file,
|
||||
GError **error);
|
||||
static gint save_image (GFile *file,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
GObject *config,
|
||||
GError **error);
|
||||
|
||||
static gboolean save_dialog (GimpProcedure *procedure,
|
||||
GObject *config,
|
||||
GimpImage *image);
|
||||
static gboolean save_dialog (GimpProcedure *procedure,
|
||||
GObject *config,
|
||||
GimpImage *image);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Sgi, sgi, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -137,9 +139,9 @@ sgi_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
sgi_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
sgi_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure,
|
||||
N_("Silicon Graphics IRIS image"));
|
||||
|
|
@ -199,11 +201,13 @@ sgi_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
sgi_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
sgi_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
|
|||
|
|
@ -80,34 +80,36 @@ struct _TiffClass
|
|||
|
||||
GType tiff_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * tiff_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * tiff_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * tiff_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * tiff_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * tiff_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * tiff_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpPDBStatusType tiff_save_rec (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *orig_image,
|
||||
gint n_orig_drawables,
|
||||
GimpDrawable **orig_drawables,
|
||||
GFile *file,
|
||||
GimpProcedureConfig *config,
|
||||
GimpMetadata *metadata,
|
||||
gboolean retried,
|
||||
GError **error);
|
||||
static GimpValueArray * tiff_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * tiff_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpPDBStatusType tiff_save_rec (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *orig_image,
|
||||
gint n_orig_drawables,
|
||||
GimpDrawable **orig_drawables,
|
||||
GFile *file,
|
||||
GimpProcedureConfig *config,
|
||||
GimpMetadata *metadata,
|
||||
gboolean retried,
|
||||
GError **error);
|
||||
|
||||
static gboolean image_is_monochrome (GimpImage *image);
|
||||
static gboolean image_is_multi_layer (GimpImage *image);
|
||||
|
|
@ -153,9 +155,9 @@ tiff_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
tiff_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
tiff_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("TIFF or BigTIFF image"));
|
||||
|
||||
|
|
@ -273,11 +275,13 @@ tiff_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
tiff_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
tiff_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpPDBStatusType status;
|
||||
|
|
@ -285,7 +289,6 @@ tiff_load (GimpProcedure *procedure,
|
|||
gboolean resolution_loaded = FALSE;
|
||||
gboolean profile_loaded = FALSE;
|
||||
gboolean ps_metadata_loaded = FALSE;
|
||||
GimpMetadata *metadata;
|
||||
GError *error = NULL;
|
||||
|
||||
gegl_init (NULL, NULL);
|
||||
|
|
@ -302,25 +305,11 @@ tiff_load (GimpProcedure *procedure,
|
|||
if (!image)
|
||||
return gimp_procedure_new_return_values (procedure, status, error);
|
||||
|
||||
metadata = gimp_image_metadata_load_prepare (image,
|
||||
"image/tiff",
|
||||
file, NULL);
|
||||
if (resolution_loaded)
|
||||
*flags &= ~GIMP_METADATA_LOAD_RESOLUTION;
|
||||
|
||||
if (metadata)
|
||||
{
|
||||
GimpMetadataLoadFlags flags = GIMP_METADATA_LOAD_ALL;
|
||||
|
||||
if (resolution_loaded)
|
||||
flags &= ~GIMP_METADATA_LOAD_RESOLUTION;
|
||||
|
||||
if (profile_loaded)
|
||||
flags &= ~GIMP_METADATA_LOAD_COLORSPACE;
|
||||
|
||||
gimp_image_metadata_load_finish (image, "image/tiff",
|
||||
metadata, flags);
|
||||
|
||||
g_object_unref (metadata);
|
||||
}
|
||||
if (profile_loaded)
|
||||
*flags &= ~GIMP_METADATA_LOAD_COLORSPACE;
|
||||
|
||||
return_vals = gimp_procedure_new_return_values (procedure,
|
||||
GIMP_PDB_SUCCESS,
|
||||
|
|
|
|||
|
|
@ -73,9 +73,10 @@ create_layer (GimpImage *image,
|
|||
}
|
||||
|
||||
GimpImage *
|
||||
load_image (GFile *file,
|
||||
gboolean interactive,
|
||||
GError **error)
|
||||
load_image (GFile *file,
|
||||
gboolean interactive,
|
||||
GimpMetadataLoadFlags *metadata_flags,
|
||||
GError **error)
|
||||
{
|
||||
uint8_t *indata = NULL;
|
||||
gsize indatalen;
|
||||
|
|
@ -88,8 +89,6 @@ load_image (GFile *file,
|
|||
uint32_t flags;
|
||||
gboolean animation = FALSE;
|
||||
gboolean icc = FALSE;
|
||||
gboolean exif = FALSE;
|
||||
gboolean xmp = FALSE;
|
||||
|
||||
/* Attempt to read the file contents from disk */
|
||||
if (! g_file_get_contents (g_file_peek_path (file),
|
||||
|
|
@ -126,12 +125,6 @@ load_image (GFile *file,
|
|||
if (flags & ICCP_FLAG)
|
||||
icc = TRUE;
|
||||
|
||||
if (flags & EXIF_FLAG)
|
||||
exif = TRUE;
|
||||
|
||||
if (flags & XMP_FLAG)
|
||||
xmp = TRUE;
|
||||
|
||||
/* TODO: decode the image in "chunks" or "tiles" */
|
||||
/* TODO: check if an alpha channel is present */
|
||||
|
||||
|
|
@ -247,38 +240,8 @@ load_image (GFile *file,
|
|||
/* Free the original compressed data */
|
||||
g_free (indata);
|
||||
|
||||
if (exif || xmp)
|
||||
{
|
||||
GimpMetadata *metadata;
|
||||
|
||||
if (exif)
|
||||
{
|
||||
WebPData exif;
|
||||
|
||||
WebPMuxGetChunk (mux, "EXIF", &exif);
|
||||
}
|
||||
|
||||
if (xmp)
|
||||
{
|
||||
WebPData xmp;
|
||||
|
||||
WebPMuxGetChunk (mux, "XMP ", &xmp);
|
||||
}
|
||||
|
||||
metadata = gimp_image_metadata_load_prepare (image, "image/webp",
|
||||
file, NULL);
|
||||
if (metadata)
|
||||
{
|
||||
GimpMetadataLoadFlags flags = GIMP_METADATA_LOAD_ALL;
|
||||
|
||||
if (profile)
|
||||
flags &= ~GIMP_METADATA_LOAD_COLORSPACE;
|
||||
|
||||
gimp_image_metadata_load_finish (image, "image/webp",
|
||||
metadata, flags);
|
||||
g_object_unref (metadata);
|
||||
}
|
||||
}
|
||||
if (profile)
|
||||
*metadata_flags &= ~GIMP_METADATA_LOAD_COLORSPACE;
|
||||
|
||||
WebPMuxDelete (mux);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,10 @@
|
|||
#define __WEBP_LOAD_H__
|
||||
|
||||
|
||||
GimpImage * load_image (GFile *file,
|
||||
gboolean interactive,
|
||||
GError **error);
|
||||
GimpImage * load_image (GFile *file,
|
||||
gboolean interactive,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GError **error);
|
||||
|
||||
|
||||
#endif /* __WEBP_LOAD_H__ */
|
||||
|
|
|
|||
|
|
@ -55,24 +55,26 @@ struct _WebpClass
|
|||
|
||||
GType webp_get_type (void) G_GNUC_CONST;
|
||||
|
||||
static GList * webp_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * webp_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
static GList * webp_query_procedures (GimpPlugIn *plug_in);
|
||||
static GimpProcedure * webp_create_procedure (GimpPlugIn *plug_in,
|
||||
const gchar *name);
|
||||
|
||||
static GimpValueArray * webp_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * webp_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * webp_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
static GimpValueArray * webp_save (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
gint n_drawables,
|
||||
GimpDrawable **drawables,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (Webp, webp, GIMP_TYPE_PLUG_IN)
|
||||
|
|
@ -115,9 +117,9 @@ webp_create_procedure (GimpPlugIn *plug_in,
|
|||
|
||||
if (! strcmp (name, LOAD_PROC))
|
||||
{
|
||||
procedure = gimp_load_procedure_new (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
webp_load, NULL, NULL);
|
||||
procedure = gimp_load_procedure_new2 (plug_in, name,
|
||||
GIMP_PDB_PROC_TYPE_PLUGIN,
|
||||
webp_load, NULL, NULL);
|
||||
|
||||
gimp_procedure_set_menu_label (procedure, _("WebP image"));
|
||||
|
||||
|
|
@ -247,11 +249,13 @@ webp_create_procedure (GimpPlugIn *plug_in,
|
|||
}
|
||||
|
||||
static GimpValueArray *
|
||||
webp_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
const GimpValueArray *args,
|
||||
gpointer run_data)
|
||||
webp_load (GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
GFile *file,
|
||||
GimpMetadata *metadata,
|
||||
GimpMetadataLoadFlags *flags,
|
||||
GimpProcedureConfig *config,
|
||||
gpointer run_data)
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpImage *image;
|
||||
|
|
@ -259,7 +263,7 @@ webp_load (GimpProcedure *procedure,
|
|||
|
||||
gegl_init (NULL, NULL);
|
||||
|
||||
image = load_image (file, FALSE, &error);
|
||||
image = load_image (file, FALSE, flags, &error);
|
||||
|
||||
if (! image)
|
||||
return gimp_procedure_new_return_values (procedure,
|
||||
|
|
|
|||
Loading…
Reference in a new issue