build: fix splash2installer.py with updated API using GeglColor instead of GimpRGB.

Fixes:

> TypeError: argument background: Expected Gegl.Color, but got gi.repository.Gimp.RGB
This commit is contained in:
Jehan 2024-02-11 16:44:05 +01:00
parent 65f8afee68
commit f8ddc94a8b
1 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,6 @@
gi.require_version('Gegl', '0.4')
from gi.repository import Gegl
image = Gimp.list_images()[0]
procedure = Gimp.get_pdb().lookup_procedure("file-bmp-save")
config = procedure.create_config()
@ -19,8 +22,7 @@ def export_scaled_img(image, target_width, target_height, export_path):
img.scale(new_width, new_height)
img.resize(target_width, target_height, offx, offy)
# XXX: should we rather use the average color as border?
black = Gimp.RGB()
black.set(0, 0, 0)
black = Gegl.Color.new("black")
Gimp.context_set_background(black)
drawables = img.list_selected_drawables()
for d in drawables: