Multichannel TIFF images do not load in Picture.LoadFromFile method
We'are trying to do a comparison of a mutichannel TIFF image and the Picture.LoadFromFile method is not able to load them.
Is this a known issue/limitation?
Don't know about multichannel TIFF images. (Do you mean multipage?)
Does the image compare to itself? Try attaching an example image along with some sample code,
Neither did I. Did a quick google and it looks like they are some sort of layered version of an image? Most of the google hits were people trying to load them into things which didn't like them. Just like this.
My guess would be they're not supported and you may need to make it a "flat" image of a supported type first.
Well, I downloaded what looked like a multipage TIFF file and did a quick Compare test of itself to a copy and it *seemed* to work...
By multichannel I meant CMYK + additional spot color channels, please find enclosed such a image.
In fact the LoadFromFile is the one that is not able to load this kind of image without throwing any error:
referencePic["LoadFromFile"](pathReference)//multichannel picture is not loaded
I tried your example file with MS Paint and Paint.NET and neither would load it.
But when I tried in in TestComplete (v11.20), it seemed to accept it OK? (I checked - and Stop On Error was switched on)
I declared an image, did a "LoadFromFile" into it, using your sample image. Then loaded another copy of it into another declared image object, and compared them. It came out TRUE. Changed the second image to a random PNG I had lying around on the drive, and the compare comes out FALSE.
Have you declared objects as images before you've tried to load the image from file?
Although, while it doesn't actually throw an error on loading, it also doesn't return any useful properties such as the handle or size. On my PNG, these are all present an populated. The TIFF shows no handle and size properties all show zero. So maybe it isn't actually loading properly and it's just comparing two empty images when I compare it with a copy of itself? Not sure.
Our initial post was misleading, sorry about that.
Indeed the Picture.LoadFromFile loads an empty Picture object, which is in fact unusable for other further operations (like Compare).
See our code snippet below:
var referencePic = Utils["Picture"];
var comparedPic = Utils["Picture"];
referencePic["LoadFromFile"](pathReference)//multichannel picture is not loaded!
if(referencePic["Compare"](comparedPic, false, threshold, false, colorTolerance))
Yeah. That matches what it seemed to be doing for me. Not loading, but not crashing, leaving you with an empty image object.
Not supported I'd say. Not many thing do seem to support them. Certainly, the other applications I tried (see above) didn't.
Paint tools are too basic, Adobe Photoshop CS3 should be used to open these types of images.
In our implementation, we ended-up using BeyondCompare to load and compare such images.