1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-05 21:02:42 +02:00

10469 Commits

Author SHA1 Message Date
Bruno Lopes
f09007507f Declare gexiv2 dependency on many targets (due to gimpmetadata.h)
Our build files were relying 'sysroot' to find gexiv2.h but this is
not possible with Apple Clang om which sysroot points to macOS SDK.
So, exotic environments like Homebrew were failing. Let's fix this.
2025-10-03 18:31:53 -03:00
Jehan
41035c7589 plug-ins: fix memory management and handle multi-file zip.
We should not call archive_entry_free() since man
archive_read_next_header explicitly says that the returned entry is an
internal object:

> This is a convenience wrapper around archive_read_next_header2() that
> reuses an internal struct archive_entry object for each request.

The only reason why it was not crashing is that we were not properly
freeing the archive itself so internal objects were hanging! The man
archive_read says:

> Once you have finished reading data from the archive, you should call
> archive_read_close() to close the archive, then call archive_read_free()
> to release all resources, including all memory allocated by the library.

Therefore this code add archive_read_free() at the end and removes
archive_entry_free().

Furthermore we now verify if the zip archive contains any other file.
Unlike all other compression formats we were supporting until now, zip
is a full multi-file container format and we are always only trying to
read the first file listed in the archive. This likely means that this
file was not meant to be opened this way. In any case, still try to load
the first file as an image, yet raise a warning about the existence of
more files in the archive.
2025-09-30 20:14:01 +02:00
Jehan
7275569079 plug-ins: localize strings and improve extension list.
- Uppercase first letter of blurbs.
- Make the blurb and documentation strings localizable and localized.
- Add the compression format extension to the list of extensions. I am
  unsure why it was set as FIXME, because it does work perfectly (per
  tests) as a generic (de)compressor plug-in for any of the image
  formats we support. Not even this, but I am even putting the generic
  extension first, because sometimes we take the first listed extension
  of a load procedure to determine the source file format. Yet the only
  thing we can say *generically* about a file loaded by these procedures
  is that it was compressed with the associated container format!
- For the new zip-support, do not show xcf.zip and xcfzip extensions in
  the list. I don't think we want to promote these new extensions as
  standard XCF variants, even though in practice this will still work
  fine. Instead add hgt.zip (but again, after the generic zip, cf.
  previous point), because we know that this is a commonly used format
  combination for HGT files.
2025-09-30 19:53:36 +02:00
Alx Sa
b633b4b9c7 python: Remove layer offsets on ORA export
When exporting formats that use image procedures
(like PNG), if we don't remove the layer offsets then
the image is cut off on export. This is because we
size the image to the layer size, but then the layer offsets
move it off the canvas. This patch fixes the issue for
ORA export.
2025-09-29 18:55:20 -03:00
Alx Sa
f032153596 plug-ins: Add zip decompression support
This patch adds support for decompressing .zip files and
loading an image within. This allows us to load zipped
images like hgt.zip and other compressed formats.
2025-09-29 19:28:18 +00:00
Jehan
3a698a05a1 plug-ins: only set the file if it's actually an inner XCF file.
Soon we will officially support .hgt.zip files (see !2483) but in fact,
even without this, the file-compressor actually support any other
formats we support, compressed into one of the container formats
supported by this plug-in.

This fixes such error message:

> gimp_image_set_file: failure to set file 'file:///home/jehan/Documents/gimp-splash-deleteme.png.gz' with extension 'gz'. The extension must be '.xcf' (or a compressed variant).
2025-09-29 17:46:33 +02:00
Bruno Lopes
c13bf1af19 build: Move loose scripts in meson subdir to tools
The build dir looks "prettier" without the meson subdir.
With prettier I mean: just the OSes subdirs.
2025-09-24 09:07:47 -03:00
Alx Sa
e27353216c plug-ins: Fix display lag in Small Tiles
Resolves #14932

In Small Tiles, we update the preview whenever
the number of segments slider is dragged. However,
while we reacted to the slider moving, we actually grab
the number from the GimpProcedureConfig object.
As a result, there's a lag between the signal firing and the
config object updating, so we don't grab the latest change.
This patch alters the signal to run when "notify::num-tiles"
is called, resulting in the update function having the updated
number.
2025-09-20 15:21:45 +00:00
Lukas Oberhuber
06bcef3273 macos plugins: Improves dock icon flashing from #12150
This means additional icons don't stick around. However, this is the easy workaround to turning everything into a proper plugin with .plist files.
2025-09-20 00:10:06 +01:00
Anders Jonsson
cb565344e9 Issue #14878: fix missing spin boxes in Map to Object plug-in
Light position spin boxes in Map to Object could be missing
or shown when they shouldn't be due to reuse of a variable.

Fixes #14878
2025-09-16 10:37:02 +00:00
Jehan
84eaa94842 plug-ins: align with __attribute__ keyword.
The bug in old Bugzilla #138357 report was happening on icc on ia64 with
-no-gcc option. It does look like after all these years, this is still a
GCC attribute, but we use the same attributes on babl and GEGL code. So
to be fair, it'd be useless to only forbid using it on GIMP code. And
that makes for much less ugly code.

Note that C11 has _Alignas() and C23 alignas() specifiers. These are
standard, but we are typically still more into C99 code. Let's see if we
move on to C11 some day… But for now, let's use __attribute__.

Also I am unsure how much this issue is still relevant nowadays. Maybe
even without specified alignment, it would now work fine with icc on
IA-64. 🤷
Or maybe it really doesn't matter that much because Itanium has been
discontinued in 2019, though I guess existing hardware will still be
around for a bit longer.
2025-09-15 19:36:29 +02:00
Jehan
7c947ef1af app, libgimpbase, plug-ins: deprecate GimpPixPipe.
This really feels like internal API which we'd want to keep private (and
used by core plug-ins only).

Also as Jacob noticed, it's not even included in libgimpbase/gimpbase.h
so plug-ins wishing to use this API need to include this file
specifically anyway (but the header is still installed and the API is
introspected).

Since we cannot remove these functions now that GIMP 3 was published,
for API stability, I am only deprecating them both in the C API with
macros and in the bindings with GObject Introspection annotations.
Therefore any third-party plug-in developer trying to use these
functions in a plug-in will get build-time or run-time warnings.

Then when we'll move on to GIMP 4 development, we can remove the
deprecation and simply make this file private-only use instead.
2025-09-11 16:23:57 +02:00
Alx Sa
4d84ac748b Issue #12012: Don't require GUI for C source and HTML export 2025-09-06 19:25:57 +00:00
Gabriele Barbero
6e80f98390 plug-ins: use a temporary image to get the buffer...
...with filters during Recompose

Previously, get_buffer_with_filters() inserted and removed a temporary
copy of a layer in the original image. This caused the image to appear
modified, adding entries in the undo history and prompting the user to save
changes, even though the image itself was not actually changed.

This patch modifies the function to create a temporary image and perform
the layer insert operation there. Filters are applied as before,
but the original image remains untouched, avoiding unwanted undo entries
and mark the image as modified.
2025-09-04 20:05:22 +02:00
Alx Sa
002b22c150 plug-ins: Fix ZDI-CAN-27793
GIMP ILBM File Parsing Stack-based Buffer Overflow
Remote Code Execution Vulnerability

Adds a check to file-iff.c to ensure the palette_size is
between 0 and 256.
2025-09-04 04:45:43 +00:00
Jacob Boerema
4eb106f2bf plug-ins: fix ZDI-CAN-27823
GIMP XWD File Parsing Heap-based Buffer Overflow Remote Code Execution
Vulnerability.

Check offset in colormap is valid before writing to it.

Closes #14814
2025-09-03 18:38:53 -04:00
Alx Sa
53b18653bc plug-ins: Fix ZDI-CAN-27836
ZDI-CAN-27836: GIMP FF File Parsing Integer Overflow
Remote Code Execution Vulnerability

This patch increases the row_size data type to gsize and checks if it
would overflow based on the width given. It also makes sure the image
size does not exceed GIMP's image size limits.
2025-09-03 22:10:34 +00:00
Anders Jonsson
2012eef75c plug-ins: remove doubled word in dicom string 2025-09-03 23:03:07 +02:00
Jacob Boerema
fb31ddf322 plug-ins: fix ZDI-CAN-27878
GIMP WBMP File Parsing Integer Overflow Remote Code Execution
Vulnerability

We recently fixed one instance of not upgrading the size, but forgot
the other. Fix that here by casting to (gsize). While we're at it,
also add a warning, when reading more data fails unexpectedly.

Closes #14812
2025-09-03 15:25:55 -04:00
Jacob Boerema
0f309f9a8d plug-ins: fix dicom plug-in ZDI-CAN-27863
GIMP DCM File Parsing Heap-based Buffer Overflow Remote Code Execution
Vulnerability

This adds more safety checks and sets actual GError's instead of just
calling gimp_quit.

Closes #14811
2025-09-03 13:34:36 -04:00
Alx Sa
5f4329d324 plug-ins: Fix ZDI-CAN-27684
Prevent overflow attack by checking if
output >= max, not just output > max.
2025-09-03 13:41:10 +00:00
lillolollo
1a144f35a6 plug-ins: fix file-exr warning and a possible memory leak 2025-09-03 12:59:39 +00:00
Anders Jonsson
fc4eb6730c plug-ins: add missing include to fix build 2025-09-02 20:02:01 +02:00
Jehan
51ba945eb1 plug-ins: add reminder to obsolete scripts in favor of proper Script-fu plug-ins.
Closure of #10652 made me realize we should probably leave a warning
reminder.
2025-09-02 19:08:48 +02:00
Jehan
b1e52381f5 libgimp*, plug-ins: add and use new GIMP_WARNING_API_BREAK() macro.
This macro will generate a #warning message when we'll move on to 3.99
series (which means we will be on our way to GIMP 4). And it will become
an #error message on 4.0.0, hence preventing us from releasing unless we
actually resolve all these warnings.

Resolution may mean actually breaking the API/ABI, or just deciding that
it's not a good idea in the end, or finding another solution. But
something will have to be decided.

Please everyone use this macro when you discover issues where it looks
like we could improve the API (in a breaking way) so that we don't
forget when approaching GIMP 4 (pushing further the improvement).

Updating the 2 place where I was already using a GIMP_CHECK_VERSION()
with #warning, and adding a new usage in the compose plug-in, per
discussion in MR !2424.
2025-08-31 17:49:24 +02:00
Alx Sa
0faa10ddd6 plug-ins: Remove metadata on J2K and PSB export
Exiv2 does not yet support metadata export for PSB
and J2K export. For now, we will turn off the metadata
options when exporting in these formats.
2025-08-31 13:22:28 +00:00
Alx Sa
cf9d39c3d7 plug-ins: Fix Recompose for YCbCr decomposed images
The strings used in decompose.c's "decompose-type" do not match
the values of compose_type for YCbCr values. This means that when
using non-interactive Recompose, there's no match and the Recompose
fails. We'll need to wait until the next API break to fix the strings.
For now, we will do additional checks if the normal compose_type check
fails and also compare the four YCbCr types from Decompose.
2025-08-31 01:53:28 +00:00
Corentin Noël
19e230e9cb plug-ins: Allow for more specific print settings with portals
In the case the "create-custom-widget" signal is not emitted (typically when
using the print portal), it is necessary to open a second dialog to fine-tune
the print settings.
2025-08-30 15:41:49 +00:00
Jehan
9519901150 libgimp, plug-ins: implement loading SVG breaking aspect ratio.
Previous implementation was always keeping ratio. If the width/height
argument were of a different aspect, librsvg simply fits the image with
original aspect within the box. Now we will appropriately scale
differently on both dimensions to have the image fill the whole box.

Note that this doesn't work with librsvg before 2.46.0 (not that it's
not possible, just that I haven't looked at how it should be implemented
there (which would be a different implementation anyway since there is
no cairo step).

Finally I add a build warning for when we'll prepare for GIMP 4, as the
pixel density arg needs to be split in 2 (each dimension can have its
own PPI), even though this is not really needed right now.
2025-08-28 23:13:03 +02:00
Jehan
d8712a525b plug-ins: fix compilation with librsvg < 2.46.0.
Note that it's not actually tested with an old librsvg, but only forcing
this code path with a new librsvg and fixing the compilation
errors/warnings which are outputted.
2025-08-28 23:13:03 +02:00
Jacob Boerema
55627934c5 plug-ins: add more file plug-in loading tests
Adds a few tga, j2k, wbmp and wmf tests.
2025-08-27 11:11:32 -04:00
Alx Sa
61c67d012b plug-ins: Fix CRITICALs and GUI issues in file-ps
Resolves #14761 (and other issues)
* Clears out the selection on GimpPageSelector on load so
that it does not try to "redraw" areas when the dialogue is closed
* Fixes layout on load dialogue to better match 2.10 (and use less
vertical space)
* Now that we have a unit property, replace the call to
gimp_label_string_widget_get_widget () with a direct connection to
changes in the config's "unit". This both fixes a CRITICAL caused by
setting a signal on a non-existent object, and restores the function
that adjusts the dimensions when the unit is changed from inches to
millimeters and back.
2025-08-27 13:02:59 +00:00
Ondřej Míchal
33f6117539 plug-ins/filter-browser: Remove Pippins's copyright
This note was relevant when the plug-in used GEGL code for collecting
available GEGL operations. This is no longer the case and thus the
copyright can be dropped.
2025-08-26 23:50:37 +00:00
Anders Jonsson
5c35946c51 plug-ins: make filter browser labels translatable 2025-08-20 14:47:24 +02:00
lillolollo
d0af548894 plug-ins: Fix memory leaks in file-gif-load.c 2025-08-16 12:38:05 +00:00
Anders Jonsson
3f13511015 plug-ins: make JPEG 2000 codestream title translatable 2025-08-15 18:31:32 +02:00
Jacob Boerema
3d91452507 plug-ins: fix issues in wbmp discovered in coverity 2025-08-15 11:59:10 -04:00
Alx Sa
aa9aa9e489 core, plug-ins: Fix bugs noted by Coverity scan
Fixes the following warnings from Coverity:
* file-paa.c: Casts "width" to guint32 to prevent overflow.
  Also, fix checks so that RGBA_8888 textures will be read.
* file-png.c: Free variables if APNG is not fully loaded
* file-seattle-filmworks.c: Verify fseek () doesn't exceed
  length of file
* file-tim.c: Casts "width" to guint32 to prevent overflow
* guillotine.c: Free "file" if image creation fails
* gimpitem.c: Initialize offset_x/y to 0 to remove warning
2025-08-15 03:38:27 +00:00
Jacob Boerema
634ebf97e7 plug-ins: fix overwriting sketchbook tiff group layer mode
in the tiff loader
Found with the coverity scan.
2025-08-14 18:58:03 -04:00
Jehan
abf026fc54 plug-ins: add a pygimp.interp on macOS too. 2025-08-14 17:28:34 +00:00
Alx Sa
c35abbe090 plug-ins: Fix signed JPEG 2000 import
Our JPEG 2000 plug-in assumed all imported images
are unsigned - however, it's possible to store signed data
as well.
This patch adds a check to see if the image has the `sgnd`
flag set to TRUE. If so, we offset the signed data to get it
into the unsigned range before converting to an image.
2025-08-14 05:27:26 +00:00
Alx Sa
6211ec8d2c plug-ins: Revert b98fe0c3
Resolves #14412
While b98fe0c3 resolved issue 10133,
it broke exporting text layers as text on
single layers, since they would be merged
beforehand. This patch reverts the change
until we find a solution that resolves both
problems.
2025-08-14 05:00:09 +00:00
Michael Natterer
9f789e68d5 app, tools, plug-ins: more #pragma once, and formatting cleanup where
I noticed the need.
2025-08-13 01:48:40 +02:00
Alx Sa
3969c002ee plug-ins: Reduce Raw Data load dialogue height
Currently, all Raw Data parameters are displayed in a column
when loading. This can cause the dialogue to go off-screen on
displays with smaller heights.
This patch adjusts the dialogue to be a two-column layout, similar
to some of our legacy plug-ins, to reduce the chance of the options
going off-screen.
2025-08-08 20:52:25 +00:00
Alx Sa
bf096c5174 plug-ins: Restore support for HRZ Slow Scan Television Images
We use to have a separate hrz.c plug-in for reading these files. It was
removed in 76a5689f.
Since HRZ is a raw 8 bit RGB image with a few extra constraints, it makes
sense to include it as an option in our Raw Data plug-in alongside HGT.
2025-08-07 21:38:46 +00:00
Alx Sa
494f3a1452 plug-ins: Add import support for Seattle Filmworks photos
This patch allows GIMP to import two formats created by
Seattle Filmworks. The earliest format SFW93A, and the most
common format SFW94A. Both formats are essentially mangled
JPEGs, though mangled in different ways.

Thanks to Loren Amelang for providing sample images and
information about the format!
2025-08-07 02:12:36 +00:00
Ondřej Míchal
69e9efe534 plug-ins: Add GEGL filter API browser
A new browser for exploring the available and supported GEGL operations
for use with the filter API. These include also all operations loaded as
GEGL plug-ins and operations registered from GIMP.

Similarly to the Procedure browser it shows also the details of
individual parameters like the allowed values and default values. In the
case of a type that is not completely supported by the GimpProtocol, the
browser can show useful information about a parameter thanks to a PDB
procedure encoding the information in a placeholder GParamSpec.
2025-08-03 21:38:28 +00:00
Alx Sa
901d1cd9d9 plug-ins: Add initial import support for PAA textures
This patch adds support for loading
compressed PAA textures.
This includes RGBA 4444, 5551, 8888, and
Grayscale with Alpha channel.
It does not yet cover DXT1 - 5 texture
import support.
2025-07-31 15:49:21 +00:00
Alx Sa
f99415c281 plug-ins: Give unique IDs to file-svg choice parameter
Resolves #14557
Per Kamil Burda, all three choices for the "paths" parameter
in file-svg had an ID of 0. This patch makes them unique.
2025-07-26 16:08:03 +00:00
Bruno Lopes
db8ead54f8 Issue #1620: plug-ins: Clarify file size string of JPEG plug-in
Closes #1620 by using the suggested string by Jacob.
2025-07-25 19:38:51 -03:00