Commit Graph

46758 Commits

Author SHA1 Message Date
Jehan 269343832a libgimp: fix (destroy) and (closure) annotations.
This fixes the following warning (and 4 similar others):
> libgimp/gimpimagecombobox.c:133: Warning: GimpUi: "destroy" annotation needs one option, none given

Brought by commit df766d5443. It's my fault for not properly reviewing
the patch as I failed to notice the new warnings.
2021-03-20 16:43:09 +01:00
Jacob Boerema a95371c2b0 plug-ins: in metadata-editor use /iptcExt instead of /Iptc4xmpExt when saving.
We need to work around an issue in Exiv2 that saving to /Iptc4xmpExt bag
records fails which seems related to it registering /iptcExt. Unregistering
that and registering the first one doesn't work.
See: https://gitlab.gnome.org/GNOME/gexiv2/-/issues/24

So let's use /iptcExt for saving even though it's the less common form
for now. When loading metadata we try to load the most common
form first and if that fails we will load /iptcExt.
2021-03-15 20:49:39 -04:00
Jacob Boerema d00fe2bfe2 plug-ins: set most common CreatorContactInfo last in metadata-editor.
Set Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:* last since the short
form Xmp.iptc.Ci* could have been used to set this information too.

Becausethe first (longer) form is the most common let that override the
shorter form in the (unlikely) case that both are present and also have
different values.

Due to a bug in the metadata-editor previously only the short form
was saved.
2021-03-14 19:19:09 -04:00
Jacob Boerema 184b803811 plug-ins: fix several memory leaks in metadata-editor. 2021-03-14 18:32:09 -04:00
Jacob Boerema f04b84cb39 plug-ins: fix using incorrect structs and fields in metadata-editor. 2021-03-14 18:07:46 -04:00
Jacob Boerema 4609def72f plug-ins: more refactoring of duplicate code in metadata-editor.
Reordered the strings in artworkorobject to be in the same
order as the columns.
Add write_metadata_tag_multiple function that handles most
of the previously duplicated code and check for special
handling of phonetype when necessary by adding
an enum and a get_phonetype function.
2021-03-12 22:05:52 -05:00
Jacob Boerema 9c2451d813 plug-ins: refactor writing single metadata tag in metadata-editor.
Use a separate function that can be reused and also get rid of
the large output_data array and strcat without length
checking. We will use GString instead.
2021-03-12 22:05:52 -05:00
Jacob Boerema 87763cbe27 plug-ins: remove use of strcpy without length checking in metadata-editor. 2021-03-12 22:05:52 -05:00
Jacob Boerema c2fa21ac7d plug-ins: remove use of global tagdata array in metadata-editor.
This removes some flawfinder warnings by not using a fixed
size array and using g_snprintf instead of g_sprintf and
using more safety checks.
2021-03-12 22:05:52 -05:00
Jacob Boerema 0a0eeac1ad plug-ins: more refactoring of metadata-editor.
There was a lot of duplicate code based on
whether or not value was NULL with for
some tags partially unreachable code.

We combine the parts and only test
value for NULL where needed.

Also rename the typos in enum
COL_REGSITRY_* to
COL_REGISTRY_*
2021-03-12 22:05:52 -05:00
Jacob Boerema e24a6dc8d6 plug-ins: refactor metadata-editor adding values to gui.
There's a lot of duplicate code for adding string values
to the gui (liststore). This is another part of trying
to reduce that.
Besides that the copying code uses fixed size arrays
without length checking as pointed out by flawfinder.

We will instead use a function add_to_store to add a
comma or semicolon separated list of values stored in
value to add rows with values to the gui.
2021-03-12 22:05:52 -05:00
Balázs Úr 0ef5d672b7 Update Hungarian translation 2021-03-11 08:31:02 +00:00
Muhammet Kara 138aadce3f Update Turkish translation 2021-03-10 20:29:37 +00:00
Jehan 106e13d5db Issue 4594: Spotify doesn't open with Gimp open.
GLib has been fixed with commit 00e848fbc.
Add it in our patch list for the Windows installer until we get a
release containing the patch.
2021-03-10 13:23:27 +01:00
Jehan 3f1cae4d6b libgimp: gimp_image_take_selected_layers() with boolean return.
Since it can fail, we should return the success value.
2021-03-08 22:40:33 +01:00
Stanislav Grinkov 1cab305231 tools: Made 'Crop tool' aware of color or pattern changes
Crop tool used stale color / pattern values when performed crop with
'Allow growing' option. Its context was not notified when fg/bg/pattern
value was changed.

Closes: #4103
2021-03-08 18:14:37 +00:00
Jacob Boerema 43b25781dc libgimp: fix annotations of gimp_image_list(_selected)_layers.
Looks like a copy paste error where element-type was
specified as GimpImage instead of GimpLayer.
2021-03-06 12:10:57 -05:00
Piotr Drąg 0442f700b6 Update Polish translation 2021-03-06 14:25:34 +01:00
Yuri Chornoivan 3fe07c1a37 Update Ukrainian translation 2021-03-06 07:55:33 +00:00
Jacob Boerema fd2aa645af plug-ins: be a little more forgiving loading g3 fax images.
Only count a broken line once and only stop after at
least 10 consecutive broken lines since older fax
images are known for having bad lines.

This enables loading the image in issues #475.
2021-03-05 14:13:37 -05:00
Jacob Boerema 1edd114834 plug-ins: improve error handling when loading g3 fax images.
Fixes issue #475 Loading a fuzzed .g3 file fails.
2021-03-05 14:13:37 -05:00
lloyd konneker f59feba611 Fix #6540 annotations on BrushSelectButton.get_brush() 2021-03-05 19:12:30 +00:00
Lloyd Konneker df766d5443 Fix annotations allowing null "constraint" and "data" args, #6526 2021-03-05 19:10:10 +00:00
Jacob Boerema 441631322b plug-ins, TIFF: Oops, forgot to save formatting fixes before committing. 2021-03-04 15:23:29 -05:00
Yuri Chornoivan dee605ce27 Update Ukrainian translation 2021-03-04 18:32:54 +00:00
Jacob Boerema a79aac687b plug-ins, TIFF: Don't try to load image with bit depth we can't handle. 2021-03-04 12:45:18 -05:00
Jacob Boerema a6d4ef8b94 plug-ins, TIFF: improve loading of miniswhite/minisblack images.
- Miniswhite and Minisblack TIFF images with bps 1, 2 and 4 were loaded as
indexed. We change this to grayscale since that's what they are.
- Fix not handling of miniswhite for 8 bps.

Fixes issue #1838 Tiff image display wrong (tiff tags not interpreted), black
line instead of white line.
Fixes issue #2680 Failure to load 4-bit grayscale TIFF layers.
2021-03-04 12:45:18 -05:00
Balázs Úr 86d1cf1c1b Update Hungarian translation 2021-03-04 08:04:35 +00:00
Balázs Úr 8ef6a9cb2c Update Hungarian translation 2021-03-04 08:02:23 +00:00
Martin Srebotnjak 17d9fb8ff1 Updated Slovenian translation 2021-03-03 17:28:27 +01:00
Martin Srebotnjak aff0c68234 Updated Slovenian translation 2021-03-03 17:27:19 +01:00
Martin Srebotnjak d004a42c35 Updated Slovenian translation 2021-03-03 17:21:12 +01:00
Martin Srebotnjak 51a0278ae2 Updated Slovenian translation 2021-03-03 17:17:36 +01:00
Jehan 8336147bdf Revert "gitlab-ci: testing gtk!1563 for Windows Ink support."
This reverts commit 32434d9fc3.
Argh sorry. I was planning on making a branch for this (not directly on
master!) and also the patch should obviously have been applied on a GTK
tree, not GIMP's. I'm probably tired! Reverting.
2021-03-03 13:21:51 +01:00
Jehan 32434d9fc3 gitlab-ci: testing gtk!1563 for Windows Ink support. 2021-03-03 12:36:45 +01:00
Yuri Chornoivan fe4cde9d48 Update Ukrainian translation 2021-03-03 07:51:21 +00:00
Matej Urbančič 038e9eaa47 Update Slovenian translation 2021-03-03 07:36:00 +00:00
Jacob Boerema 20cedd4c0c plug-ins: improve a few error messages and allow translating.
Improved and added a few error messages and made all
user visible messages (g_message) translatable.
2021-03-02 17:11:52 -05:00
Jacob Boerema 2ff9ccf46c plug-ins: add more safety checks when loading a TIFF image.
Testing some fuzzed TIFF images from the imagetestsuite
revealed we should add some more checks for valid input
and function returns.

We now stop whenever the reported bps is above 64.
Even if it is valid we can't handle it anyway and I'm not
aware of any actual valid image like that.

Make sure the image dimensions are valid and in the range
that GIMP can handle.

Return directly when TIFFReadRGBAImage fails instead
of doing further processing and improve the error message.

Check result of TIFFReadTile and return if it fails.
2021-03-02 17:11:52 -05:00
Jacob Boerema 97739af643 plug-ins: libtiff warnings can cause a crash on Windows.
Certain broken tiff fax images can cause a huge amount of warnings
which on Windows eventually causes GIMP to run out of resources
and then crash.

Since the avarage user won't have much use for these warnings
let's just only send them to stderr.
2021-03-02 17:11:52 -05:00
Jehan a44de4679f libgimp: fix annotation.
Fixing the GIR warning:
>  Warning: Gimp: gimp_image_take_selected_layers: argument layers: Missing (element-type) annotation
2021-03-02 18:43:41 +01:00
Jehan f0a8c0c3f5 plug-ins: also generate grayscale color profiles from gAMA/cHRM chunks.
The PNG specs says:
> The cHRM chunk is allowed in all PNG datastreams, although it is of
little value for greyscale images.

Though it doesn't say it's completely useless though. So let's still
extract the info and give it to Little-CMS.
As for the gAMA chunk, it doesn't say it's not usable for grayscale
images.

Note that if one of the 2 values is not set, it will use default values
for sRGB (i.e. default simili-sRGB gamma or d65 whitepoint). Not sure if
this is totally right.

See also issue #6501.
2021-03-02 12:02:23 +01:00
Marco Ciampa 87669c2a1c Updated Italian translation 2021-03-01 11:21:09 +01:00
Piotr Drąg 64128c7787 Update Polish translation 2021-02-27 13:46:49 +01:00
Jordi Mas fb0deacdeb Update Catalan translation 2021-02-26 18:34:39 +01:00
Anders Jonsson 2abf23c812 Update Swedish translation 2021-02-25 18:33:50 +00:00
Yuri Chornoivan a3a6607b92 Update Ukrainian translation 2021-02-25 17:53:01 +00:00
Stanislav Grinkov 8977c1055d
gui: Update text of 'Crop tool' option to 'Selected layers only'
To better reflect that tool can crop multiple selected layers.
2021-02-25 23:02:04 +06:00
Anders Jonsson e83faedb9d Update Swedish translation 2021-02-24 21:50:30 +00:00
Stanislav Grinkov 6959426603
tools: Rectangle select. Incorrect center_xy after converting channel selection to rectangle
Was caused by widget tool fixed_center_x and fixed_center_y coordinates set to
coordinates of mouse click instead of rectangle center after converting channel
selection bbox to rectangle.

Now rectangle fixed_center_x and fixed_center_y coordinates are always updated
when tool widget x1, x2, y1, or y2 coordinates are updated.

Closes #6487
2021-02-24 22:18:43 +06:00