Re: [Gimp-developer] Sometimes the contents of config/devicerc are not read

2016-06-09 Thread Simon Budig
Elle Stone (ellest...@ninedegreesbelow.com) wrote:
> "Error while parsing '/home/elle/code/gimpdefault/install/config/devicerc'
> in line 7: unexpected character '-', expected number (float) - fatal parse
> error"

Yay, now the implicit assumptions crop up   :)

Thanks for spotting this.

> 2. From glib:
> 
> When using GIMP, when the color picker picks an out of gamut color, glib
> prints to the terminal the following message:
> 
> (gimp-2.9:1865): GLib-GObject-WARNING **: value "((GimpRGB*) 0xde2f30)" of
> type 'GimpRGB' is invalid or out of range for property 'color' of type
> 'GimpRGB'

This is not actually glib. Somewhere in the definition of GimpRGB we
apparently register one getter/setter function that errors when
encountering negative or >= 1 values. This needs fixing in gimp itself.

Mitch: is extending the range of GimpRGB harmless enough to do?

Bye,
 Simon
-- 
  si...@budig.de  http://simon.budig.de/
___
gimp-developer-list mailing list
List address:gimp-developer-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list


[Gimp-developer] Sometimes the contents of config/devicerc are not read

2016-06-09 Thread Elle Stone
When using GIMP 2.9/2.10 at floating point precision, various editing 
operations can generate RGB colors that have one or more channel values 
that are outside the range 0.0 to 1.0.


These out of gamut floating point colors generate two inconvenient error 
messages, one from GIMP and one from glib:



1. From GIMP:

If the last Foreground/Background color that was picked is out of gamut, 
then upon restarting GIMP a pop-up message says:


"Error while parsing 
'/home/elle/code/gimpdefault/install/config/devicerc' in line 7: 
unexpected character '-', expected number (float) - fatal parse error"


The same message is printed to the terminal.

Triggering this error message seems to keep GIMP from reading the entire 
contents of config/devicerc, which changes things the user might have 
configured, including:


* The colors stored for the FG/BG tool revert to black and white.
* The preselected paint dynamics revert to Dynamics Off.
* The preselected brush reverts to the clipboard.

The error can be eliminated by removing the following two lines from 
libgimpconfig/gimpscanner 
(https://git.gnome.org/browse/gimp/tree/libgimpconfig/gimpscanner.c):


gimp_hsv_clamp (&hsv);
gimp_rgb_clamp (&color);


2. From glib:

When using GIMP, when the color picker picks an out of gamut color, glib 
prints to the terminal the following message:


(gimp-2.9:1865): GLib-GObject-WARNING **: value "((GimpRGB*) 0xde2f30)" 
of type 'GimpRGB' is invalid or out of range for property 'color' of 
type 'GimpRGB'


These error messages can be eliminated by removing the following lines 
from glib's gobject/gobject.c 
(https://git.gnome.org/browse/glib/tree/gobject/gobject.c):


  else if (g_param_value_validate (pspec, &tmp_value) && !(pspec->flags 
& G_PARAM_LAX_VALIDATION))

{
  gchar *contents = g_strdup_value_contents (value);

  g_warning ("value \"%s\" of type '%s' is invalid or out of range 
for property '%s' of type '%s'",

 contents,
 G_VALUE_TYPE_NAME (value),
 pspec->name,
 g_type_name (pspec->value_type));
  g_free (contents);
}

Can the glib people be persuaded to do something about the glib error 
message? I perused the internet and notice other people complaining 
about other error messages that glib prints to the screen. I couldn't 
find a compile option for glib to eliminate these messages.


Best,
Elle
___
gimp-developer-list mailing list
List address:gimp-developer-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list