From 0faa10ddd615f8d71eacb86fd4e9b925b9b9131f Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Sun, 31 Aug 2025 13:22:28 +0000 Subject: [PATCH] plug-ins: Remove metadata on J2K and PSB export Exiv2 does not yet support metadata export for PSB and J2K export. For now, we will turn off the metadata options when exporting in these formats. --- plug-ins/common/file-jp2.c | 12 ++++++++---- plug-ins/file-psd/psd.c | 14 +++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/plug-ins/common/file-jp2.c b/plug-ins/common/file-jp2.c index e536d1124b..34924688e4 100644 --- a/plug-ins/common/file-jp2.c +++ b/plug-ins/common/file-jp2.c @@ -471,8 +471,6 @@ jp2_create_procedure (GimpPlugIn *plug_in, FALSE, G_PARAM_READWRITE); #endif - - gimp_export_procedure_set_support_comment (GIMP_EXPORT_PROCEDURE (procedure), TRUE); } return procedure; @@ -1718,13 +1716,19 @@ export_image (GFile *file, "quality", &quality, "ict", &ict, "resolution", &resolution, - "include-comment", &save_comment, - "gimp-comment", &comment, #if ((OPJ_VERSION_MAJOR == 2 && OPJ_VERSION_MINOR == 5 && OPJ_VERSION_BUILD >= 3) || \ (OPJ_VERSION_MAJOR == 2 && OPJ_VERSION_MINOR > 5) || OPJ_VERSION_MAJOR > 2) "cmyk", &cmyk, #endif NULL); + if (! strcmp (gimp_procedure_get_name (procedure), EXPORT_JP2_PROC)) + g_object_get (config, + "include-comment", &save_comment, + "gimp-comment", &comment, + NULL); + else + save_comment = FALSE; + compliance = gimp_procedure_config_get_choice_id (GIMP_PROCEDURE_CONFIG (config), "compliance"); diff --git a/plug-ins/file-psd/psd.c b/plug-ins/file-psd/psd.c index 77ba6976b4..481a9223c4 100644 --- a/plug-ins/file-psd/psd.c +++ b/plug-ins/file-psd/psd.c @@ -305,11 +305,15 @@ psd_create_procedure (GimpPlugIn *plug_in, FALSE, G_PARAM_READWRITE); - gimp_export_procedure_set_support_exif (GIMP_EXPORT_PROCEDURE (procedure), TRUE); - gimp_export_procedure_set_support_iptc (GIMP_EXPORT_PROCEDURE (procedure), TRUE); - gimp_export_procedure_set_support_xmp (GIMP_EXPORT_PROCEDURE (procedure), TRUE); - gimp_export_procedure_set_support_profile (GIMP_EXPORT_PROCEDURE (procedure), TRUE); - gimp_export_procedure_set_support_thumbnail (GIMP_EXPORT_PROCEDURE (procedure), TRUE); + /* TODO: Remove condition when PSB metadata is supported by Exiv2 */ + if (! strcmp (name, EXPORT_PROC)) + { + gimp_export_procedure_set_support_exif (GIMP_EXPORT_PROCEDURE (procedure), TRUE); + gimp_export_procedure_set_support_iptc (GIMP_EXPORT_PROCEDURE (procedure), TRUE); + gimp_export_procedure_set_support_xmp (GIMP_EXPORT_PROCEDURE (procedure), TRUE); + gimp_export_procedure_set_support_profile (GIMP_EXPORT_PROCEDURE (procedure), TRUE); + gimp_export_procedure_set_support_thumbnail (GIMP_EXPORT_PROCEDURE (procedure), TRUE); + } } else if (! strcmp (name, LOAD_METADATA_PROC)) {