Support Center

Imageman in a webservice

Dan May 17, 2012 08:36PM EDT

I seem to be having trouble using this in a web service, .ashx.cs file. I'm using the trial version for evaluation right now.

I'm trying to write a stream to a DTI.ImageManSeekableReadOnlyStream, but it keeps giving me an error:
MemoryStream theMemStream = new MemoryStream();
theMemStream.Write(uploadBytes, 0, uploadBytes.Length);
DTI.ImageMan.SeekableReadOnlyStream imgstream = new SeekableReadOnlyStream(theMemStream);

It's the last line that it always has problems with. Even if I try to get it from a file, I'll get a bad response from the web service. On a command line app this works ok though. I think I'm missing something very basic. I'm using a raduploadHandler by telerik.

3 Data Techniques Responses and 3 Community Responses

Up 6 Rated Down
DTI Support  Data Techniques Employee May 17, 2012 09:48PM EDT

Hello,

What is the error you are getting ?

Thanks,
Sean
Data Techniques Inc Support

Up 4 Rated Down
Dan  Data Techniques Employee May 18, 2012 01:42PM EDT

I can't seem to catch the error message. I put it in a try catch and try to write the error to a file, but the Telerik RadUploadHandler just fails. But the above code looks ok to put in a web service. I'll try to find a way to get the error message then

Up 6 Rated Down
DTI Support  Data Techniques Employee May 18, 2012 04:30PM EDT

Hi Dan,

is there any chance you could send us the solution or a sample and we can have a look at it ?

Thanks,
Sean

Up 5 Rated Down
Dan  Data Techniques Employee May 18, 2012 05:49PM EDT

Sorry, I just didn't copy the Imageman DDLs to the server. Needed to add 'Copy Local' to true on the properties to the references.

Up 7 Rated Down
Dan  Data Techniques Employee May 18, 2012 08:53PM EDT

Now I'm getting an error that I'm not getting on my local machine:
"Object reference not set to an instance of an object."
Maybe am I missing a file for the license, that I need to copy over for the trial version. Because when I debug on my machine the imagine try or buy popup comes up.

Utils.writeErrorLog("A imgLen=" + imgstream.Length.ToString());
DTI.ImageMan.ImDecoder decoder = DTI.ImageMan.RegisteredDecoders.GetDecoder(imgstream);

The above is where it errors, but the imgstream isn't null.

Up 3 Rated Down
DTI Support  Data Techniques Employee May 21, 2012 09:58AM EDT

Hi,

I suspect you are running into a problem loading the DTI.ImageMan.Codecs.dll assembly. That assy is provied in both 32 and 64 bit versions, you need to copy the appropriate one for the bitness of your ASP.Net application.

Once you do that you should be OK.

Thanks for your interest in our products and please let us know if you have any questions.

Sincerely,
Sean
Data Techniques Support

This question is closed to new answers.

Contact Us