Skip to content
  1. Apr 20, 2024
    • Jehan's avatar
      libgimp, libgimpcolor: make real unit test of old (compiled but unused) … · 62ab8e26
      Jehan authored
      … test-color-parser.c file.
      
      The file libgimpcolor/test-color-parser.c was compiled but never actually called
      by the build. Now that we have a nice infrastructure to test libgimp API, I am
      moving it there with the new format. Doing this also allowed me to discover some
      bugs in CSS parsing, as well as discover Python binding was failing here (cf.
      the few previous commits).
      
      Only one test is disabled so far, the one where 4 digits are used per channel in
      hexadecimal notation: "#64649595eded". This format simply doesn't appear
      anywhere in the spec, and also the result values in the samples listing don't
      even fit. So far, I'm just unsure what to do with it, if we want to keep this
      support (of some kind of higher precision hex notation, but not specified, so is
      it even used by anyone?) or not.
      
      All the other tests just work in both C and Python!
      62ab8e26
    • Jehan's avatar
      libgimpcolor, app: gimp_color_parse_(css|hex|name)() renamed with _substring() suffix. · 106d1860
      Jehan authored
      New functions with the same name as these functions are created, except without
      the length argument (i.e. it's equivalent to calling these with -1).
      
      The reason for this is that using strings with a length variant which may be
      negative to switch to NUL-terminated strings are not bindable. At least in our
      case, when testing in Python, the input string ended up as corrupted garbage and
      GObject Introspection docs warns about such interfaces:
      
      > In particular, avoid functions taking a const char * with a signed length that
      > can be set to a negative value to let the function compute the string length
      > in bytes. These functions are hard to bind, and require manual overrides.
      
      (see: https://gi.readthedocs.io/en/latest/writingbindableapis.html#strings)
      
      So instead, I create a simple version which runs on NUL-terminated strings only
      and which is bound, whereas unbinding the generic length-version (making it
      C-only, or maybe us...
      106d1860
    • Jehan's avatar
      plug-ins: script-fu is now GimpRGB-free. · d51cde85
      Jehan authored
      d51cde85
    • Jehan's avatar
      libgimpcolor: gimp_rgb_parse_hex() is also unused. · 6a85efe9
      Jehan authored
      6a85efe9
    • Jehan's avatar
      libgimpcolor: fix CSS parsing. · 9f205ca6
      Jehan authored
      - "transparent" is now recognized. It was forgotten (probably because on the
        GimpRGB interface, we separated the API in a _rgb_ and a _rgba_ variant).
      - rgba() and hsla() formats are now fixed (implementation was there but the
        function names were not recognized.
      - Adding some comment about limitations of the hexadecimal notation (we don't
        support the alpha channel which is now in the CSS specs, while we also support
        some non-specified variant with every channel on 3 or 4 digits) for future
        work.
      9f205ca6
  2. Apr 19, 2024
  3. Apr 18, 2024
  4. Apr 17, 2024