mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
plug-ins: Fix crash for bumpmaps without alpha channels
979a3c3c
assumed that all bumpmaps in the Lighting Effects plug-in
would have an alpha channel, which is not always the case.
This patch adds a check via gimp_drawable_has_alpha (), and sets the
babl format accordingly.
This commit is contained in:
parent
fe6e1d77c8
commit
c408d44e03
1 changed files with 6 additions and 2 deletions
|
@ -397,15 +397,19 @@ bumpmap_setup (GimpDrawable *bumpmap)
|
|||
{
|
||||
if (bumpmap)
|
||||
{
|
||||
gboolean has_alpha = gimp_drawable_has_alpha (bumpmap);
|
||||
|
||||
if (! bump_buffer)
|
||||
{
|
||||
bump_buffer = gimp_drawable_get_buffer (bumpmap);
|
||||
}
|
||||
|
||||
if (gimp_drawable_is_rgb (bumpmap))
|
||||
bump_format = babl_format ("R'aG'aB'aA u8");
|
||||
bump_format = has_alpha ? babl_format ("R'aG'aB'aA u8") :
|
||||
babl_format ("R'G'B' u8");
|
||||
else
|
||||
bump_format = babl_format ("Y'aA u8"); /* FIXME */
|
||||
bump_format = has_alpha ? babl_format ("Y'aA u8") : /* FIXME */
|
||||
babl_format ("Y' u8");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue