I would like to use the PIL module to resize an image stored in a blob (geodatabase attachment table) but I cannot create the Image object from the string representation in the pythonCaller
This is what I have tried so far:
import fme, fmeobjects
from PIL import Image
from io import StringIO
def processFeature(feature):
string_io = StringIO(feature.getAttribute("data"))
img = Image.open(string_io) #here I have the following error: Python Exception <OSError>: cannot identify image file <_io.StringIO object at 0x0000000007CE4438>
img = img.resize((1000, int(round((width / float(img.sizeg0])) * img.size>1]))), Image.ANTIALIAS)
I have the following error Python Exception <OSError>: cannot identify image file <_io.StringIO object at 0x0000000007CE4438>