OS Ubuntu 12.04 precise, python 2.7.3, pyramid web framework, IM 6.4.7-1
I've got Python code (inside a Pyramid Web Framework application, but that should be irrelevant) which takes a captured image capture.jpg and then needs to do two ImageMagick processes on the image. The first is convert to label the image (works), the second is composite to apply a watermark over the image and label (doesn't work). At first I thought the second operation silently failed due to the image not being ready, but adding a wait timer indicates that's not so. Any idea of how to combine both operations? They can't be combined into one shell command.
now = datetime.datetime.utcnow()
inpfile = "/home/brian/capture.jpg"
tfile = "/home/brian/watermark.png"
label = ("SN7 %s" % now.strftime("%Y%m%d%H%M%S"))
outfile = ("/home/brian/%s" % now.strftime("CAM_%Y%m%d%H%M%S") + ".jpg")
args = []
args += ["-background", "White"]
args += ["-pointsize","42"]
args += ["label: "+ label]
args += ["-gravity", "Center"]
args += ["-append"]
subprocess.check_call(["convert",inpfile] + args + [outfile])
time.sleep(5)
imp = []
imp += ["-dissolve", "25"]
imp += ["-gravity", "South"]
subprocess.check_call(["composite"] + [imp] + tfile + outfile + outfile)
return []