This improves commit bbd5ebbe8a. Several parameters did not need to go
inside draw_layer(). In particular this function should not take care of
filling return values on errors. It should just return a success boolean
with a GError which is processed on the main function. This also allows
proper shortcut to end the loop earlier on the first error.
Also the layer index parameter does not need to be a pointer since it
never requires updates.
Finally declare variables in smaller scopes for cleaner code.
(cherry picked from commit 5b2d89f794)
Added a recursive loop to draw layer children in layer groups. Text
layers in layer groups are now exported correctly.
(cherry picked from commit bbd5ebbe8a)
Whereas normal layers of dimension 0x0 are definitely broken, group and
text layers depend on their contents, which will be able to resize the
layer appropriately and fix whatever rendering. This commit allows to
salvage such layers, hence make XCF loading even more resistant to
certain form of file corruption.
This commit (and the previous one) are not theoretical but the result of
discovering some old corrupted file, with an empty group of size 0x0
(saved by GIMP itself, because of some old bug). Rather than destroying
these layer groups, this just allows us to reopen them without any kind
of loss!
(cherry picked from commit 06be074650)
If the problem occurs at one of the first layer, we may end up loading
nearly nothing even though there may be a whole lot of other data in
good state. So instead keep track of the number of failed layer and
channel loading to still display an error popup at the end, because we
still need to alert the user something went wrong. Yet damages are
limited.
Also make sure that layer paths are fixed when some layers could not be
loaded, hence stored paths end up wrong.
(cherry picked from commit 2045fdd2a3)
Make the returned values of g_list_length() a gint to avoid implicit
type conversion converting a possibly negative integer numberator into
unsigned int (which ends as a huge unsigned int instead of being
negative).
Found by Massimo!
(cherry picked from commit a6ad02a60a)
gsapi_new_instance() now expects a pointer to a NULL-initialized
pointer. Initialize "void *instance" with NULL. Found by massimo.
(cherry picked from commit bbcc7ca5f5)
- move use of deprecated function to very few places
- indentation, formatting
- fix insane variable names, it's now much more readable
(cherry picked from commit 8ac6ec2a00)
by plain pixel region code, copied right out of gimpregioniterator.c.
Makes porting to GEGL easier and GimpRegionIterator unused.
(cherry picked from commit 775abb03f3)
...for gimp_context_set_antialias(antialias)
Mention gimp_context_set_antialias() in the stroke docs, and mention
the stroke functions in the antialias docs.
(cherry picked from commit 7a589951c9)