InvalidParameter on all treatments from an image scanned in 24 bits

Discussions about image processing and document imaging.
Post Reply
alex38
Posts: 5
Joined: Thu Aug 24, 2017 12:42 pm

InvalidParameter on all treatments from an image scanned in 24 bits

Post by alex38 » Thu Aug 24, 2017 12:55 pm

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
Attachments
0981_170822171040_001.tif

alex38
Posts: 5
Joined: Thu Aug 24, 2017 12:42 pm

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

Post by alex38 » Fri Sep 01, 2017 12:12 pm

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

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

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

Post by Loïc » Fri Sep 01, 2017 6:37 pm

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

alex38
Posts: 5
Joined: Thu Aug 24, 2017 12:42 pm

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

Post by alex38 » Tue Sep 05, 2017 8:38 am

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
Attachments
24bitHQ.tif

alex38
Posts: 5
Joined: Thu Aug 24, 2017 12:42 pm

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

Post by alex38 » Mon Sep 11, 2017 2:03 pm

Up

alex38
Posts: 5
Joined: Thu Aug 24, 2017 12:42 pm

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

Post by alex38 » Tue Oct 03, 2017 11:14 am

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
Attachments
24bitHQ.zip
(822.73 KiB) Downloaded 371 times

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

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

Post by Loïc » Fri Oct 06, 2017 4:31 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest