Hi Community.
I´m currently working on a script that is able to send an email thru (arc)PY.
I´m using a searhcursor to find the relavant data including blob-data from the _ATTACH table.
But I´m missing a way to convert the blob data to an image (via the PIL framework)
I´ve tried something like this:
with arcpy.da.SearchCursor(_fcAttach,fieldsIn) as imageCursor:
for row in imageCursor:
tmpImg = row[1] #the 'DATA'-field
binary_data = base64.b64decode(tmpImg)
ioData = io.BytesIO(binary_data)
image = Image.open(ioData)
But I get an error like:
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x0000011D99E7BE50>
Any suggestions or ideas?
Regards
Kåre