
Right now, it only tests a few API, such as creating an image, then a text layer, then inserting it in the image. This is a test to avoid regression bug after having fixed #9923 in a previous commit.
16 lines
568 B
Python
16 lines
568 B
Python
#!/usr/bin/env python3
|
|
|
|
NEW_IMAGE_WIDTH=1920
|
|
NEW_IMAGE_HEIGHT=2001
|
|
|
|
image = Gimp.Image.new(NEW_IMAGE_WIDTH, NEW_IMAGE_HEIGHT, Gimp.ImageBaseType.RGB)
|
|
gimp_assert('Gimp.Image.new()', type(image) == Gimp.Image)
|
|
|
|
images = Gimp.get_images()
|
|
gimp_assert('Gimp.get_images()', len(images) == 1 and images[0] == image)
|
|
|
|
text_layer = Gimp.TextLayer.new(image, "hello world", Gimp.context_get_font(), 20, Gimp.Unit.point())
|
|
gimp_assert('Gimp.TextLayer.new()', type(text_layer) == Gimp.TextLayer)
|
|
|
|
gimp_assert('Gimp.Image.InsertLayer()', image.insert_layer(text_layer, None, 0))
|