Maria Romero Posted April 19, 2019 Share Posted April 19, 2019 Hello there I am trying to load image from my C: drive in a data table. The only example I found is one video that shows how to do perform this with a data that has flags creating a bynary column.https://www.youtube.com/watchv=c41ScJs1b_k I downloaded the example that comes with an Script. Please bared in mind that I know how to steal a script and sometimes use it succesfully but I am not a programer. The Script stops at line 8 with the following error. File "", line 8, in ValueError: Unsupported type conversion Does anybody can help to understand how to overcome this problem I have added a column in my table as 'string', as 'text', as 'number' called Flags but still giving me this message. Or any other alternative for loading images in a data table from your C: drive ---------------- from Spotfire.Dxp.Data import * from System.IO import * from System.Drawing import * from System.Drawing.Imaging import * table=Document.Data.Tables["Core Sampling2"] column=table.Columns["Flags"] cursor=DataValueCursor.Create[binaryLargeObject](column); for row in table.GetRows(cursor): value=cursor.CurrentValue stream=value.GetByteStream() img=Image.FromStream(stream) filePath="C:ImagesmyImage" + str(row.Index) + ".Jpeg" img.Save(filePath, ImageFormat.Jpeg) Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted April 19, 2019 Share Posted April 19, 2019 Your "Flags" column should be of type "Binary" as you are creating a DataValueCursor of type "BinaryLargeObject". As you are adding your column as integer or string it throws error in line 8. IF you check the attached dxp, the Flags column is of Binary data type. Link to comment Share on other sites More sharing options...
Maria Romero Posted April 22, 2019 Author Share Posted April 22, 2019 Yes, I am aware of that, however theres is not an option to input a binary column. I was thinking that this is what the code will do. Do you know how to input or create a binary colunm thanks, Maria Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now