Page 1 of 1

InvalidParameter on all treatments from an image scanned in 24 bits

Posted: Thu Aug 24, 2017 12:55 pm
by alex38
Hello

We're currently evaluating your framework for image processing and enhancement, but we encountered a problem this morning that may block us :

I scanned the survey in attachment, in color, resulting in this multipage tiff in 24bits. A call to TiffCreateMultiPageFromFile() gives me an imageId, status is OK. Good.
Then I try to get a BitmapSource out of it, using this code :

Code: Select all

var bitmapSource = GdPictures.GPI.GetBitmapSourceFromGdPictureImage(ImageId);
if (bitmapSource == null)
{
	_logger.Error($"An error occured {GdPictures.GPI.GetStat().ToString()}");
}
bitmapSource is null, and the GetStat() tells me InvalidParameter. I tried several other method, like ConvertTo1Bpp(ImageId), it returns the same.
I didn't release the image in the process, so it shouldn't be the issue.

All this code works fine with images scanned in Black&White. Paint is able to open the file without problem....
Do you have any idea of what is going on ?

Thank you

Re: InvalidParameter on all treatments from an image scanned in 24 bits

Posted: Fri Sep 01, 2017 12:12 pm
by alex38
Hello,

Any news on this topic? Do you need some more informations from me ? (I forgot to say I use GdPicture 14).
Or can you give me a way to have more detailed informations, other than calling GetStat() ?

Alex

Re: InvalidParameter on all treatments from an image scanned in 24 bits

Posted: Fri Sep 01, 2017 6:37 pm
by Loïc
Hi,

You obtain an invalidparameter status because the id of the image passed as parameter in invalid.

If you provide a code snippet that we can run I will probably be able to explain you where the problem is.

Kind regards,

Loïc

Re: InvalidParameter on all treatments from an image scanned in 24 bits

Posted: Tue Sep 05, 2017 8:38 am
by alex38
Hello Loïc.

Thank you for your answer.
Here's a code snippet with which I can reproduce the problem :

Code: Select all

LicenseManager oLicenseManager = new LicenseManager();
			oLicenseManager.RegisterKEY(GDPICTURE_KEY);
			var _oGPI = new GdPictureImaging();

			var imageId = _oGPI.CreateGdPictureImageFromFile("Path_to_file\\24bitHQ.tif");
			var status = _oGPI.GetStat();
			Console.WriteLine($"Reading 24 bits image : id is {imageId}. Status is {status}"); //Status is OK. Id is 1
			status = _oGPI.SelectPage(imageId, 1);
			Console.WriteLine($"Selecting page 1 on image with id {imageId}. Status is {status}"); //Status is OK
			status = _oGPI.FxDespeckle(imageId);
			Console.WriteLine($"Applying FxDespeckle on image with id {imageId}. Status is {status}"); //Status is InvalidParameter
			status = _oGPI.FxBitonalDespeckle(imageId, false);
			Console.WriteLine($"Applying FxBitonalDespeckle on image with id {imageId}. Status is {status}"); //Status is InvalidParameter
			var pixelFormat = _oGPI.GetPixelFormat(imageId);
			Console.WriteLine($"Getting PixelFormat on image with id {imageId}. Status is {status}. Pixel format is {pixelFormat.ToString()}"); //Status is InvalidParameter. Pixel format is 1bpp???
The file I used is attached to this post.

Kind regards
Alex

Re: InvalidParameter on all treatments from an image scanned in 24 bits

Posted: Mon Sep 11, 2017 2:03 pm
by alex38
Up

Re: InvalidParameter on all treatments from an image scanned in 24 bits

Posted: Tue Oct 03, 2017 11:14 am
by alex38
I just saw the file is not readable once downloaded there though it's readable on my computer.
In the zip it seems fine now, sorry, you should have told me.
Can you have a look with the code snippet ?

Thanks.
Alex

Re: InvalidParameter on all treatments from an image scanned in 24 bits

Posted: Fri Oct 06, 2017 4:31 pm
by Loïc
Hi,

I think the problem is solved since a while now. Could you check with our latest release if the problem persists? I was not able to reproduce it.

Kind regards,

Loïc