Skip to content

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

Description

@gentilijuanmanuel

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions