2014-09-15 12:42:21 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
from gi.repository import Vips
|
|
|
|
|
2014-10-05 10:28:17 +02:00
|
|
|
im = Vips.Image.new_from_file(sys.argv[1], access = Vips.Access.SEQUENTIAL)
|
2014-09-15 12:42:21 +02:00
|
|
|
|
2014-10-16 12:22:03 +02:00
|
|
|
footer = Vips.Image.black(im.width, 150)
|
2014-10-05 10:28:17 +02:00
|
|
|
left_text = Vips.Image.text("left corner", dpi = 300)
|
|
|
|
right_text = Vips.Image.text("right corner", dpi = 300)
|
2014-10-16 12:22:03 +02:00
|
|
|
footer = footer.insert(left_text, 50, 50)
|
|
|
|
footer = footer.insert(right_text, im.width - right_text.width - 50, 50)
|
|
|
|
footer = footer.ifthenelse(0, [255, 0, 0], blend = True)
|
2014-09-15 12:42:21 +02:00
|
|
|
|
2014-10-05 10:28:17 +02:00
|
|
|
im = im.insert(footer, 0, im.height, expand = True)
|
2014-09-15 12:42:21 +02:00
|
|
|
|
|
|
|
im.write_to_file(sys.argv[2])
|