The function's documentation was already saying that we could set no
profile, except that in reality, setting NULL for the profile was simply
failing. Unless one checked the return value, the failure is also quite
silent. So let's actually implement what the docs say.
Also the concept of "default" profile might be a bit unclear in GIMP as
it could mean either built-in profiles or preferred ones (as set in
Preferences). I chose the former for this function, so I reword this
part of the docs.
I noticed that the issue of the combo box popup getting immeidately
closed on Linux X11 (and probably macOS as well) only happens when using
GimpUnitComboBox as used in gimppropwidgets.c and gimpsizeentry.c while
there is no issue when used in gimpstatusbar.c
The only noticable difference I saw was that in status bar was that
the wrap width of combo box was set to 1 via
gtk_combo_box_set_wrap_width. Which was added as a hack for another
issue.
I did the same for the other two uses of GimpUnitComboBox and the issue
disappeared so I moved this hack to GimpUnitComboBox itself as it seems
to be generally useful.
The change doesn't make much sense to me and is a workaround for
something that should probably be changed in GTK but well.
As explored in !2654 I think we shouldn't use GtkComboBox but reimplement
using a Popover. This would get rid of these workarounds as we wouldn't rely
on internal behaviour of GtkComboBox.
Couldn't test macOS or Windows but Linux X11 and Wayland work just fine.
Tested by: GDK_BACKEND=x11 gimp and GDK_BACKEND=wayland gimp
Fixes#12491
Superseedes !2654
With a cell size half the width of a grayscale image with an alpha
channel, we get a crash because we write outside our buffer.
When computing the offset in the buffer, we added the offset of the
tile, but since we are just writing this tile. We should not add that
offset.
Empty layer groups have no dimensions,
which can cause the GIH exporter to
crash when splitting cells (as it produces
negative width & height dimensions).
To prevent this, this patch initializes
potential brushes to NULL, verifies the
dimensions are positive before trying to
create GimpTempBuf with then, and prevents
a possible NULL brush from being added
to the exported brush list.
Previously, the on-canvas text editor would be repositioned only if it was completely
outside the display. If it was partially off-screen, it could be hard to
move it back inside (e.g. when only a small part of the editor was visible
and difficult to grab). Now, the editor is always adjusted to remain fully
visible within the display
Unlike for Curves (commit 7b4f0993e8), we cannot just change the "trc"
default of "gimp:levels", because then it could break any existing
script, made during the 3.0 series, which was applying this filter on
layers.
Instead, the "trc" stays linear by default for the op, but the tool's
dialog will override it to perceptual.
When we'll have implemented proper op versioning, we will be able to
change the default.
This property is fully ignored right now and was only kept for
compatibility reasons. One of the compatibility issue was config
parsing, but config migration rules were added on commit 955ff5b765.
The second compatibility issue was the case where this op may have been
used in existing scripts. Yet "gimp:curves" could not have been used in
the GIMP 3.0 API since GimpCurve type did not exist in libgimp. It could
even less be used directly though GEGL API because a plug-in process
doesn't see the "gimp:*" ops (only through our GimpDrawableFilter API).
So we can safely remove this arg now. Unfortunately we can't do the same
for "gimp:levels" because it was usable during the GIMP 3.0 series.
In 046c8f27, we added a new function
gimp_selection_options_get_mode_box () so that the
Paint Select tool would use the same enum as other
selection tools. Code was added to move the
GIMP_CHANNEL_OP_REPLACE enum to the front only if
it was greater than the min value and less than the max value
that was passed in. This was to allow the Paint Select tool to
keep GIMP_CHANNEL_OP_ADD at the front while leaving the
other selection tools as they are.
However, the original call used 0, 0 for those values, so the
rearrangement code never ran at all. This patch changes the
parameter max value to GIMP_CHANNEL_OP_INTERSECT so
that Replace is moved for non-Paint Select tools.
The "Save"/"Save as" icons that appear in the Quit
Dialog when there are two or more images with unsaved
changes were always sized as GTK_ICON_SIZE_MENU,
or 16px, regardless of icon theme settings.
This patch adds code on Quit Dialog creation to check
the current theme and update the icon size accordingly
via `quit_style_updated ()`.
Note that this is a limited implementation due to the pending
release of GIMP 3.2. It is not connected to notify::custom-icon-size
signals to reduce complexity and potential issues.
In the future, we may move this to the parent GimpMessageDialog
if other dialogs would also benefit from getting a button icon size from
the theme.
A buffer overflow in the PCX reader was reported.
The +1 was added in commit da217088d0
to allow loading where the images have an off by 1 value. However,
this leaves the problem that allocated buffers may be 1 byte too small.
Because we prefer to keep loading as many images as possible, we choose
not to return an error. Instead we allocate 1 extra byte for the
line buffers.
In addition to that, we add check for valid values of bpp and error
out early when invalid.
If the bytesperline value is off by more than 1, we output a warning
message and use the manually computed value instead.
Additionally add a comment that we need to fix a British English
word in a string after string freeze.
Per Jacob Boerema, the DCX loading plug-in left
behind stray images. This is because we load each
PCX image inside the DCX as a separate image and then
copy it as a layer into the first one. However, we were
not deleting the temporary image afterwards.
This patch adds a call to gimp_image_delete () to do
the clean-up work after copying the layer from the
temporary image.
Resolves#14617
Previously, we had defined the Default theme for
GtkTextView text with "textview" and "textview text".
However, the Python console also outputs some text
that is formatted by "textview.view". Since we did not
define a style here, it was possible for a System theme leak,
resulting in unreadable console output (separate from console
input).
This patch should resolve the issue by adding textview.view to
the GtkTextView definitions in common.css.
Resolves#15289
This patch replaces the initial allocation of pixel_row
with a per-format allocation. This should resolve issues
where the allocation was too small for certain formats,
without requiring a large allocation for all formats regardless
of need.
Resolves#9545
When exporting a JPEG as CMYK, it is possible for the
"Save Profile" metadata option to be unchecked. This causes
the image to be saved without its CMYK profile, resulting in an
incorrect image rendering.
As this is almost never the desired case, this patch changes the
export logic to always save the profile IF the user has requested
CMYK export and a CMYK profile is attached.
Additionally, this patch fixes an issue in the export dialog where
the DCT options are shown as a radio frame instead of a combobox
as in GIMP 2.10.
Reported as ZDI-CAN-28874.
For psp images with bit depth 1 or 4 bits and small widths, it was
possible to overflow the buffer because these bit depths are stored
in multiples of 4 bytes per line.
Because these formats are converted to regular RGB, this means that for
small widths, more bytes are needed than expected when we are upscaling
to 8-bit.
To fix this, we compute the line size when depth < 8, and adjust
line width if that value is larger.
Found all now unused blurbs with:
for macro in `grep -rI '^#define \([A-Z0-9_]*\)' app/config/gimprc-blurbs.h | sed 's/#define \([A-Z0-9_]*\).*$/\1/'`; do
grep -rIq "$macro" * --exclude=gimprc-blurbs.h;
if [ $? -ne 0 ]; then
echo $macro;
fi;
done
Only exception was LAST_REVISION_BLURB, which was not used, but should
have been.