Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"System.ArgumentOutOfRangeException Invalid image type" when trying to encode a jpg image #17

Open
gentilijuanmanuel opened this issue Apr 9, 2019 · 0 comments

Comments

@gentilijuanmanuel
Copy link

Hi,

I'm testing the library in a Xamarin.Forms project. I have a jpg image in my resources, and I want to encode it and get the encoded Stream.
In order to do that, I created an BlkImgDataSrc, then I get the byte array of the encodable source. Finally, I convert the byte array in a Stream.
The code:

var encodableSource = J2kImage.CreateEncodableSource(myStream);
var byteArray = J2kImage.ToBytes(encodableSource);
var encodedStream = new MemoryStream(byteArray);

I get an error in the first line: "System.ArgumentOutOfRangeException. Invalid image type Parameter name: streams".

Am I doing something wrong?

Note: I'm using CSJ2K 3.0.0.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant