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.
This commit is contained in:
Jehan 2021-09-27 12:57:33 +02:00
parent 878c3f6ce6
commit e213f1f4ef
3 changed files with 31 additions and 17 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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