Reading TIF file using ObjectScript
Hi,
I'm trying to read a TIF file using ObjectScript.
I know that it is possible to achieve using python or R, but I don't know how to do it using ObjectScript.
If anyone has done it before and has some advice, I really appreciate it.
Best Regards,
Henrique
Product version: IRIS 2020.4
If it's just pure import / export the .TIF you may access it as %Stream.FileBinary
But if you need some more sophisticated processing and have some working method (eg. in Python)
you may use it in some near future with the promised embedded Python [@Bob Kuszewski ]
Until then you may take a look to my example in OEX about using Python methods & classes over CPIPE
Thanks, Robert
I'll take a look for sure!
TIF is an image format, what do you mean by reading this kind of files using ObjectScript? What do you want to get from reading it? Something like OCR tools does?
I know that is an image format, but I'm trying to read the TIF file's information to create a script to deal with landslide situations.
I don't understand what you mean.
You should understand that ObjectScript is not a good way, to deal with such data as pictures, it's not a task for databases to deal with pictures on a low-level. If you need it on ObjectScript level, I would recommend using imagemagick tool, which is external for sure, and available for any platform. But you will get a lot of functionality. and getting image info as well, and you will not be limited by tiff format only. And in addition you will get the ability to do some other stuff with images, scaling, drawing conversion, and so on, it's very powerful.
After a brief look at the tif format, it found to be quite tricky to get ImageSize.
Thanks @Dmitry Maslennikov
I'm not sure, what you want to do, but if you want to read a tiff file by byte-by-byte and the interpret it in some kind, there is a very simple example for the start.
The method below returns the file type (gif,jpg,png or tif) based on the magic number.
I have also a method to retrive the image size (pixelsWidth and pixelsHeight) for the same (gif,jpg,png and tif) files. If you are working on similar problem, I could post this method too.
Hi @Julius Kavay
It would be great if you can share your method to retrieve the image size too.
Ok, here I am... sorry for the delay.
***********************************************
Forget it!
I'm unable to copy and paste a program (in this case a method) into this text box!
After paste operation, some lines are joint, others not, the indention is lost...
Maybe I'm just too dumb to work with the text box...
*****************************************
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue