update tests again
This commit is contained in:
parent
2e2cc9ea7a
commit
23c04fcfee
10
python/im.sh
Executable file
10
python/im.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
convert $1 \
|
||||
-background Red -density 300 \
|
||||
-font /usr/share/fonts/truetype/msttcorefonts/Arial.ttf \
|
||||
-pointsize 12 -gravity south -splice 0x150 \
|
||||
-gravity southwest -annotate +50+50 "left corner" \
|
||||
-gravity southeast -annotate +50+50 'right corner' \
|
||||
+repage \
|
||||
$2
|
@ -2,24 +2,20 @@
|
||||
|
||||
import sys
|
||||
|
||||
#import logging
|
||||
#logging.basicConfig(level = logging.DEBUG)
|
||||
|
||||
from gi.repository import Vips
|
||||
from vips8 import vips
|
||||
|
||||
im = Vips.Image.new_from_file(sys.argv[1])
|
||||
|
||||
im = im | im
|
||||
im = Vips.Image.new_from_file(sys.argv[1], access = Vips.Access.SEQUENTIAL)
|
||||
|
||||
black = Vips.Image.black(im.width, 150)
|
||||
red = black + [255, 0, 0]
|
||||
left = Vips.Image.text("Left corner").embed(50, 50, im.width, 150)
|
||||
right_text = Vips.Image.text("Right corner")
|
||||
red = (black + [255, 0, 0]).cast(Vips.BandFormat.UCHAR)
|
||||
left_text = Vips.Image.text("left corner", dpi = 300)
|
||||
right_text = Vips.Image.text("right corner", dpi = 300)
|
||||
|
||||
left = left_text.embed(50, 50, im.width, 150)
|
||||
right = right_text.embed(im.width - right_text.width - 50, 50, im.width, 150)
|
||||
footer = (left | right).ifthenelse(black, red, blend = True)
|
||||
|
||||
footer = (left | right).blend(black, red)
|
||||
|
||||
im = im.insert(footer, 0, im.height - footer.height)
|
||||
im = im.insert(footer, 0, im.height, expand = True)
|
||||
|
||||
im.write_to_file(sys.argv[2])
|
||||
|
Loading…
Reference in New Issue
Block a user