[gimp] plug-ins: minor styling fixes and other.



commit e213f1f4efbd29bd4e0967357a89e44d2c167b74
Author: Jehan <jehan girinstud io>
Date:   Mon Sep 27 12:57:33 2021 +0200

    plug-ins: minor styling fixes and other.
    
    - .gitignore and gimprc.common updated by manually running ./mkgen.pl.
    - Coding style fixes in file-jpegxl:
      * function names go to the line by themselves (return type on previous
        line).
      * avoid some overlong lines by breaking lines between parameters.
      * fix some alignments.

 plug-ins/common/.gitignore    |  2 ++
 plug-ins/common/file-jpegxl.c | 45 +++++++++++++++++++++++++++----------------
 plug-ins/common/gimprc.common |  1 +
 3 files changed, 31 insertions(+), 17 deletions(-)
---
diff --git a/plug-ins/common/.gitignore b/plug-ins/common/.gitignore
index d44397acbe..abaac0333e 100644
--- a/plug-ins/common/.gitignore
+++ b/plug-ins/common/.gitignore
@@ -68,6 +68,8 @@
 /file-html-table.exe
 /file-jp2-load
 /file-jp2-load.exe
+/file-jpegxl
+/file-jpegxl.exe
 /file-mng
 /file-mng.exe
 /file-pat
diff --git a/plug-ins/common/file-jpegxl.c b/plug-ins/common/file-jpegxl.c
index 3e7aa45420..0859af7c02 100644
--- a/plug-ins/common/file-jpegxl.c
+++ b/plug-ins/common/file-jpegxl.c
@@ -188,9 +188,10 @@ jpegxl_create_procedure (GimpPlugIn  *plug_in,
   return procedure;
 }
 
-static GimpImage *load_image (GFile        *file,
-                              GimpRunMode   runmode,
-                              GError      **error)
+static GimpImage *
+load_image (GFile        *file,
+            GimpRunMode   runmode,
+            GError      **error)
 {
   gchar            *filename = g_file_get_path (file);
 
@@ -407,7 +408,9 @@ static GimpImage *load_image (GFile        *file,
 
   result_size = 4 * pixel_format.num_channels * (size_t) basicinfo.xsize * (size_t) basicinfo.ysize;
 
-  if (JxlDecoderGetColorAsEncodedProfile (decoder, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, 
&color_encoding) == JXL_DEC_SUCCESS)
+  if (JxlDecoderGetColorAsEncodedProfile (decoder, &pixel_format,
+                                          JXL_COLOR_PROFILE_TARGET_DATA,
+                                          &color_encoding) == JXL_DEC_SUCCESS)
     {
       if (color_encoding.white_point == JXL_WHITE_POINT_D65)
         {
@@ -449,13 +452,17 @@ static GimpImage *load_image (GFile        *file,
 
   if (!profile)
     {
-      if (JxlDecoderGetICCProfileSize (decoder, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, &icc_size) == 
JXL_DEC_SUCCESS)
+      if (JxlDecoderGetICCProfileSize (decoder, &pixel_format,
+                                       JXL_COLOR_PROFILE_TARGET_DATA,
+                                       &icc_size) == JXL_DEC_SUCCESS)
         {
           if (icc_size > 0)
             {
               gpointer raw_icc_profile = g_malloc (icc_size);
 
-              if (JxlDecoderGetColorAsICCProfile (decoder, &pixel_format, JXL_COLOR_PROFILE_TARGET_DATA, 
raw_icc_profile, icc_size)
+              if (JxlDecoderGetColorAsICCProfile (decoder, &pixel_format,
+                                                  JXL_COLOR_PROFILE_TARGET_DATA,
+                                                  raw_icc_profile, icc_size)
                   == JXL_DEC_SUCCESS)
                 {
                   profile = gimp_color_profile_new_from_icc_profile (raw_icc_profile, icc_size, error);
@@ -539,7 +546,8 @@ static GimpImage *load_image (GFile        *file,
 
   if (basicinfo.num_color_channels == 1) /* grayscale */
     {
-      image = gimp_image_new_with_precision (basicinfo.xsize, basicinfo.ysize, GIMP_GRAY, loadlinear ? 
GIMP_PRECISION_FLOAT_LINEAR : GIMP_PRECISION_FLOAT_NON_LINEAR);
+      image = gimp_image_new_with_precision (basicinfo.xsize, basicinfo.ysize, GIMP_GRAY,
+                                             loadlinear ? GIMP_PRECISION_FLOAT_LINEAR : 
GIMP_PRECISION_FLOAT_NON_LINEAR);
 
       if (profile)
         {
@@ -556,7 +564,8 @@ static GimpImage *load_image (GFile        *file,
     }
   else /* RGB */
     {
-      image = gimp_image_new_with_precision (basicinfo.xsize, basicinfo.ysize, GIMP_RGB, loadlinear ? 
GIMP_PRECISION_FLOAT_LINEAR : GIMP_PRECISION_FLOAT_NON_LINEAR);
+      image = gimp_image_new_with_precision (basicinfo.xsize, basicinfo.ysize, GIMP_RGB,
+                                             loadlinear ? GIMP_PRECISION_FLOAT_LINEAR : 
GIMP_PRECISION_FLOAT_NON_LINEAR);
 
       if (profile)
         {
@@ -638,11 +647,12 @@ jpegxl_load (GimpProcedure        *procedure,
 }
 
 
-static gboolean    save_image (GFile                *file,
-                               GimpProcedureConfig *config,
-                               GimpImage            *image,
-                               GimpDrawable         *drawable,
-                               GError              **error)
+static gboolean
+save_image (GFile                *file,
+            GimpProcedureConfig  *config,
+            GimpImage            *image,
+            GimpDrawable         *drawable,
+            GError              **error)
 {
   JxlEncoder        *encoder;
   void              *runner;
@@ -682,9 +692,9 @@ static gboolean    save_image (GFile                *file,
   gimp_progress_init_printf ("Exporting '%s'.", filename);
 
   g_object_get (config,
-                "lossless",           &lossless,
-                "compression",        &compression,
-                "speed",              &speed,
+                "lossless",              &lossless,
+                "compression",           &compression,
+                "speed",                 &speed,
                 "uses-original-profile", &uses_original_profile,
                 NULL);
 
@@ -707,7 +717,8 @@ static gboolean    save_image (GFile                *file,
 
       if (error && *error)
         {
-          g_printerr ("%s: error getting the profile space: %s\n", G_STRFUNC, (*error)->message);
+          g_printerr ("%s: error getting the profile space: %s\n",
+                      G_STRFUNC, (*error)->message);
           g_free (filename);
           return FALSE;
         }
diff --git a/plug-ins/common/gimprc.common b/plug-ins/common/gimprc.common
index c17fe2991b..ff4dc1710d 100644
--- a/plug-ins/common/gimprc.common
+++ b/plug-ins/common/gimprc.common
@@ -31,6 +31,7 @@ file_header_RC = file-header.rc.o
 file_heif_RC = file-heif.rc.o
 file_html_table_RC = file-html-table.rc.o
 file_jp2_load_RC = file-jp2-load.rc.o
+file_jpegxl_RC = file-jpegxl.rc.o
 file_mng_RC = file-mng.rc.o
 file_pat_RC = file-pat.rc.o
 file_pcx_RC = file-pcx.rc.o


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]