I'm using the tempfile
module and imagemagick
and when i try to run this code:
width = height = 100
temp_file = tempfile.NamedTemporaryFile()
canvas = "convert -size {}x{} canvas:black {}/canvas.png".format(scale_width, scale_height, temp_file.name)
os.system(canvas)
I get the following error:
convert: unable to open image
/var/folders/jn/phqf2ygs0wlgflgfvvv0ctbw0009tb/T/tmpeMcIuh/canvas.png': Not a directory @ error/blob.c/OpenBlob/2705. convert: WriteBlob Failed
/var/folders/jn/phqf2ygs0wlgflgfvvv0ctbw0009tb/T/tmpeMcIuh/canvas.png' @ error/png.c/MagickPNGErrorHandler/1630.
What could be the problem? I'm just trying to create a black image (resolution of 100x100) stored in a randomly generated temp file.
Thanks!