The list of selected layers may be empty, which doesn't matter much
because we don't actually do much with this list in current export code.
In the code modified in this commit, we were only using existing layers
to set the type of a new layer (which seems very useless right now as
anyway the layer type has to be the image base type with or without
alpha, so a with_alpha boolean parameter would be just as good, unless
we plan to support different color model layers in a same image).
This seems to have been broken since much longer, but it only made a
problem with recent changes. Since we were duplicating layer groups and
contents layers at once, the current code could not keep layer selection
other than at root level in a duplicated image.
Use the layer paths to make sure we select exactly the right copied
layers, since the path should not change in a fully duplicated image.
It just says "The GIMP team" so it's kind of redundant/useless, but I
noticed that Flathub would just display an empty "Developer" section
because the tag is absent. Well at least it emphasizes the
community-developed side of GIMP.
In file-tiff, add an option to crop the layers to the image bounds
when exporting individual layers (using GIMP_EXPORT_NEEDS_CROP
added in the previous commit), since TIFF has no concept of global
image bounds otherwise. Cropping is enabled by default.
Add a new GIMP_EXPORT_NEEDS_CROP export capability, which causes
gimp_export_image() to crop the exported image content to the image
bounds; this is useful for formats that support layers, but have no
concept of global image bounds, hence cropping is the only way to
enforce the image bounds.
When showing the export dialog, give an option to either crop the
layers to the image bounds, or to resize the image to fit the
layers.
When exporting a TIFF file without merging the image, make sure non
of the exported layers has a negative offset, by offsetting all the
layers as necessary. TIFF doesn't support negative page offsets,
giving an error in libtiff.
When loading a TIFF file with signed-int samples, convert the
samples to unsigned-int by offsetting them to the unsigned range,
instead of misinterpreting them as unsigned values.
The GDK_WINDOWING_X11 build-time macro check is not enough as GDK can be
built with both X11 and Wayland backends. We need to add a runtime check
of the type of display.
So it seems that pango_attr_iterator_range() could return G_MAXINT for
a Pango attribute when it is at the end of the preedit string. Looking
at Pango code, I see they initialize the attribute end property to
PANGO_ATTR_INDEX_TO_TEXT_END (G_MAXUINT), later clamped to G_MAXINT by
pango_attr_iterator_range(). So I guess for the specific case where we
are at the text end, it is normal. Only weird thing is that this didn't
happen at all on X11, only in Wayland.
So let's do our own pre-check. Also double the check by adding a UTF-8
validation.
This fixes preedit text not being displayed and the following warning:
> Gtk-CRITICAL **: 12:31:25.118: gtk_text_buffer_emit_insert: assertion 'g_utf8_validate (text, len, NULL)' failed
Even worse, this was potentially an out-of-range reading, though
fortunately checked early enough.
In gimp.css, don't set a minimum height for GimpDisplayShell
statusbars. Instead, in GimpStatusbar, set the widget's minimum
height to the maximum of its children's natural heights. Note that
we have to do this manually, instead of using a size group, since
GtkSizeGroup::ignore-hidden is deprecated (and nonfunctional) in
GTK3.
In begin_run() and end_run(), sync string properties set to
GIMP_ARGUMENT_SYNC_PARASITE with image parasites of the same name,
exactly the way "gimp-comment" was handled by begin_export() and
end_export(). Remove the "gimp-comment" handling code from
begin_export() and end_export().
which can be set to GIMP_ARGUMENT_SYNC_NONE (the default) or
GIMP_ARGUMENT_SYNC_PARASITE, which indicates that the argument should
be synced with an image parasite of the same name.
Align GimpSpinScale with gimp-2-10, by modifying its appearance and
behavior to match the 2.10 compact style, fixing interaction along
the way. Unlike 2.10, there is no option to revert to the old
style.