Todd Johnson 2 Posted July 11, 2023 Share Posted July 11, 2023 I modified the code in the article below to read data from a BLOB document property but I get an "Invalid Parameter" error at the Image.FromStream(stream) line.The BLOB in question is a Bitmap saved as PNG image type that is written to the document property by a similar IronPython script. The image is correctly rendered as a label in a text area.https://community.spotfire.com/s/article/How-to-read-Binary-column-values-and-save-as-images-TIBCO-Spotfire-Using-IronPython-Scriptingfrom Spotfire.Dxp.Data import *from System.IO import *from System.Drawing import *from System.Drawing.Imaging import *blob = Document.Properties["myImage"]stream=blob.GetByteStream()img=Image.FromStream(stream)#img=Image.FromStream(stream,0,1) Link to comment Share on other sites More sharing options...
Andrew Berridge Posted July 14, 2023 Share Posted July 14, 2023 Hi there - do you have a simple test file that we can use to experiment with? I have some ideas.... you can email me at dr@spotfire.com and I'll provide you with a way of sending it over. Thanks, Andrew (Spotfire Data Science) Link to comment Share on other sites More sharing options...
Todd Johnson 2 Posted July 14, 2023 Author Share Posted July 14, 2023 Thanks for reaching out. After posting this question, I discovered that I was attempting to run the script while the doc property (blob) was empty, hence the invalid parameter error. When the doc property was reloaded with an image, the code worked. 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