1. 27 Nov, 2018 1 commit
    • Jehan's avatar
      plug-ins: make various usage of g_file_replace() safer. · 66ec4672
      Jehan authored
      As I did on app/, finalizing an output stream also implicitly flushes
      and closes it. Hence if an export ended with an error, we'd end up with
      incomplete data file (possibly overwriting a previously exported image).
      Only 2 plug-ins I haven't fixed yet are file-tiff-io and file-gif-save.
      The later one don't even clean up its memory (which somehow is good here
      as at least the output stream is never finalized hence sane files are
      not overwritten in case of errors). As for the former (TIFF plug-in), it
      doesn't even seem to have any error control AFAICS, apart from printing
      error messages on standard error output.
  2. 24 Nov, 2018 1 commit
  3. 14 Nov, 2018 1 commit
  4. 08 Nov, 2018 1 commit
    • Jehan's avatar
      Issue #2431: After coloring a selection and exporting to PDF, file... · ba98b98f
      Jehan authored
      ... only shows the color (and nothing else) when "Convert bitmaps to
      vector graphics where possible" was set.
      This is because gimp_drawable_histogram() only checks selected pixels.
      So let's make sure we work on a duplicate of the image so that we can
      safely remove the selection before processing the export.
      (cherry picked from commit 679e3412)
  5. 01 Nov, 2018 1 commit
    • Jehan's avatar
      Issue #2160: Exporting to PCX results in a warped file. · 5d319b77
      Jehan authored
      Add line data padding when necessary.
      Additionally I realize we should convert to little-endian after checking
      the bytesperline oddness (this bug was most likely unnoticed until now
      as most desktop proc are little endian now anyway).
  6. 30 Oct, 2018 1 commit
  7. 22 Oct, 2018 5 commits
  8. 20 Oct, 2018 3 commits
  9. 19 Oct, 2018 2 commits
  10. 16 Sep, 2018 2 commits
    • Jehan's avatar
      plug-ins: add the "msf1" brand for HEIF files. · 64b00b5c
      Jehan authored
      After Dirk Farin had another look in the specs, it turns out that "mif1"
      is actually allowed as major brand for HEIF. Also adding "msf1" which is
      the equivalent for image sequences.
    • Jehan's avatar
      Issue #2209: more accurate magic for HEIF files. · 4ad3993e
      Jehan authored
      Just looking for "ftyp" would also match other ISOBMFF files (.mov or
      .mp4 files for instance). These are the possible 4-byte "brand" code
      which can follow "ftyp", as listed by Dirk Farin from libheif.
      I add the "mif1" brand, as I encountered some files using this magic
      (even though this should normally not be valid apparently, yet the file
      loaded fine in GIMP).
      This is not perfect as the standard allows potentially very big box
      headers, in which case 8 bytes (the "largesize" slot) may be inserted
      between "ftyp" and the brand, as I understand it. But this is actually
      unlikely enough to probably never happen (the compatible brands list
      would have to be huuuge, as it looks like this is the only extendable
      part in a ftyp box). So let's assume this just never happens.
      See also: https://github.com/strukturag/libheif/issues/83
  11. 14 Sep, 2018 1 commit
    • Jehan's avatar
      Issue #2209: HEIF: Invalid input: No 'ftyp' box. · d738d2f6
      Jehan authored
      Adding a magic number for HEIC/HEIF, which would allow to discard
      obvious non-HEIC images even with the wrong extension.
      Note: it looks like this magic number would also match more generically
      other ISO base media file format (ISOBMFF) formats, like .mov or .mp4
      files. I am enquiring for better magic but for now, this is better than
  12. 11 Sep, 2018 3 commits
  13. 10 Sep, 2018 4 commits
  14. 12 Aug, 2018 1 commit
    • Jehan's avatar
      plug-ins: replace s/printf/g_printf/ · 0832bbd7
      Jehan authored
      When cross-compiling, I got various linking errors for printf() calls:
      > undefined reference to `libintl_printf'
      I am unsure why, since this is not recent code, and it used to build
      fine with mingw64 compilers (last I cross-built, which is many months
      ago). Anyway g_printf() works fine, all necessary libs are already
      linked, and it is supposed to be a synonym. So let's just go the easy
      way and use g_printf() only.
      (cherry picked from commit c49afa4f)
  15. 06 Aug, 2018 1 commit
  16. 21 Jul, 2018 1 commit
    • Michael Natterer's avatar
      Initial space invasion commit in GIMP · e09e563a
      Michael Natterer authored
      All babl formats now have a space equivalent to a color profile,
      determining the format's primaries and TRCs. This commit makes GIMP
      aware of this.
      - enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
        as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
        NON_LINEAR and PERCPTUAL for each encoding, matching the babl
        encoding variants RGB, R'G'B' and R~G~B~.
      - gimp_color_transform_can_gegl_copy() now returns TRUE if both
        profiles can return a babl space, increasing the amount of fast babl
        color conversions significantly.
      - TODO: no solution yet for getting libgimp drawable proxy buffers in
        the right format with space.
      - follow the GimpPrecision change.
      - TODO: everything else unchanged and partly broken or sub-optimal,
        like setting a new image's color profile too late.
      - add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
        replacement for all "linear" booleans.
      - change gimp-babl functions to take babl spaces and GimpTRCType
        parameters and support all sorts of new perceptual ~ formats.
      - a lot of places changed in the early days of goat invasion didn't
        take advantage of gimp-babl utility functions and constructed
        formats manually. They all needed revisiting and many now use much
        simpler code calling gimp-babl API.
      - change gimp_babl_format_get_color_profile() to really extract a
        newly allocated color profile from the format, and add
        gimp_babl_get_builtin_color_profile() which does the same as
        gimp_babl_format_get_color_profile() did before. Visited all callers
        to decide whether they are looking for the format's actual profile,
        or for one of the builtin profiles, simplifying code that only needs
        builtin profiles.
      - drawables have a new get_space_api(), get_linear() is now get_trc().
      - images now have a "layer space" and an API to get it,
        gimp_image_get_layer_format() returns formats in that space.
      - an image's layer space is created from the image's color profile,
        change gimpimage-color-profile to deal with that correctly
      - change many babl_format() calls to babl_format_with_space() and take
        the space from passed formats or drawables
      - add function gimp_layer_fix_format_space() which replaces the
        layer's buffer with one that has the image's layer format, but
        doesn't change pixel values
      - use gimp_layer_fix_format_space() to make sure layers loaded from
        XCF and created by plug-ins have the right space when added to the
        image, because it's impossible to always assign the right space upon
        layer creation
      - "assign color profile" and "discard color profile" now require use
        of gimp_layer_fix_format_space() too because the profile is now
        embedded in all formats via the space.  Add
        gimp_image_assign_color_profile() which does all that and call it
        instead of a simple gimp_image_set_color_profile(), also from the
        PDB set-color-profile functions, which are essentially "assign" and
        "discard" calls.
      - generally, make sure a new image's color profile is set before
        adding layers to it, gimp_image_set_color_profile() is more than
        before considered know-what-you-are-doing API.
      - take special precaution in all places that call
        gimp_drawable_convert_type(), we now must pass a new_profile from
        all callers that convert layers within the same image (such as
        image_convert_type, image_convert_precision), because the layer's
        new space can't be determined from the image's layer format during
        the call.
      - change all "linear" properties to "trc", in all config objects like
        for levels and curves, in the histogram, in the widgets. This results
        in some GUI that now has three choices instead of two.
        TODO: we might want to reduce that back to two later.
      - keep "linear" boolean properties around as compat if needed for file
        pasring, but always convert the parsed parsed boolean to
      - TODO: the image's "enable color management" switch is currently
        broken, will fix that in another commit.
  17. 14 Jul, 2018 2 commits
  18. 13 Jul, 2018 1 commit
  19. 11 Jul, 2018 2 commits
  20. 07 Jul, 2018 1 commit
  21. 06 Jul, 2018 3 commits
  22. 27 Jun, 2018 2 commits