Giter VIP home page Giter VIP logo

csj2k's People

Contributors

anders9ustafsson avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csj2k's Issues

Requested bitrate is too small.

With every image, loaded from byte[] i got this error:

at CSJ2K.j2k.codestream.reader.FileBitstreamReaderAgent..ctor (CSJ2K.j2k.codestream.reader.HeaderDecoder hd, CSJ2K.j2k.io.RandomAccessIO ehs, CSJ2K.j2k.decoder.DecoderSpecs decSpec, CSJ2K.j2k.util.ParameterList pl, System.Boolean cdstrInfo, CSJ2K.j2k.codestream.HeaderInfo hi) [0x00384] in C:\csj2k\CSJ2K\j2k\codestream\reader\FileBitstreamReaderAgent.cs:377
at CSJ2K.j2k.codestream.reader.BitstreamReaderAgent.createInstance (CSJ2K.j2k.io.RandomAccessIO in_Renamed, CSJ2K.j2k.codestream.reader.HeaderDecoder hd, CSJ2K.j2k.util.ParameterList pl, CSJ2K.j2k.decoder.DecoderSpecs decSpec, System.Boolean cdstrInfo, CSJ2K.j2k.codestream.HeaderInfo hi) [0x00012] in C:\csj2k\CSJ2K\j2k\codestream\reader\BitstreamReaderAgent.cs:1087
at CSJ2K.J2kImage.FromStream (System.IO.Stream stream, CSJ2K.j2k.util.ParameterList parameters) [0x000aa] in C:\csj2k\CSJ2K\J2kImage.cs:111
at CSJ2K.J2kImage.FromBytes (System.Byte[] j2kdata, CSJ2K.j2k.util.ParameterList parameters) [0x00007] in C:\csj2k\CSJ2K\J2kImage.cs:55

`

                    var bmp = J2kImage.FromBytes(Convert.FromBase64String(data)).As<Bitmap>();`

Gamma or brightness appears wrong after encoding.

Using the following code to convert a jpg to a jp2. When I read the jp2 the image appears too light (brightness or gamma appear to be off). Any ideas?

BitmapImageCreator.Register();
using (var bitmap = (Bitmap)Image.FromFile(@"C:\temp\jp2\llb.jpg"))
{
var enc = J2kImage.ToBytes(bitmap);
File.WriteAllBytes(@"C:\temp\jp2\llb.jp2", enc);
}

ARGB decoding

Hi. Thanks for your previous answer.

Running a few tests, it appeared that csj2k cannot decode argb files.
Do you confirm that fact, or were my files (encoded with XnView) malformed?

Thanks,
Sylvain.

Handle >8-bit pixels correctly

Currently, pixel data using more than 8 bits per pixel component is discarded; int data is truncated to byte in the PortableImage construct. CSJ2K should ensure that these data are sufficiently transferred to output.

Loading a jp2 file exception appears

After loading a jp2 file, the following error appears:
System.OutOfMemoryException: Array dimensions exceeded supported range.

Loading is done like this: J2kImage.FromFile(sourceFile.FullName)
Version 3.0.0

The file could be uploaded if desired

Encoding in codectest does not work

Just compiled the codectest. While opening file1.jp2 to file10.jp2 works ok, file11.jp2 to file14.jp2 (which were encoded by the codectest) all show constant grayvalues of 128.

Does this work on your system?

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

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!

.NET Core unable to find BitmapImageCreator

I had to use the CSJ2K.NetCore nuget package instead of the CSJ2K nuget package in order to be able to use CSJ2K.Util.BitmapImageCreator.Register();.

Is this normal that you have to use the .NetCore nuget package to be able to use BitmapImageCreator on .NET Core 3.1? As I was not able to find this in the CSJ2K package.

The first line of this code doesn't build when using the CSJ2K package because BitmapImageCreator is not found:

          CSJ2K.Util.BitmapImageCreator.Register();
            bmp = CSJ2K.J2kImage.FromBytes(data).As<Bitmap>();

(I'm using Microsoft.WindowsDesktop.App as Framework dependency)

Decoding jpeg2000 codestream fail - Invalid number of components: 5

Hi, i´m developing an iOS app with Xamarin using your library.

Servers send me J2C codestream files. When trying to open i get
Invalid number of components: 5.

I have no control how the file is created because the servers aren´t run by me.
The files are created with kakadu library.

Thanks for your help.
Monti

Mac Gimp 2.0 can open the file
image

This is the file (renamed to .txt should be j2c)
test.txt

Index was outside the bounds

The attached sample image cant be decompressed, it does open in irfanview alright it happens with any image which is compressed with 33003 jp2k
file15.zip

The exact error it get is 'Index was outside the bounds of the array. at CSJ2K.j2k.image.ImgDataConverter.getData(DataBlk blk, Int32 c, Boolean intern) '

License problems

I am not sure this would be useful, but our legal team just reviewed the license of the product, as we were planning to use it in commercial product.

The conclusion was that the license is strange and that products using the code must conform to the ISO/IEC 15444-1 standard - something that is very time-consuming to verify. Too bad that such good project is restricted by a bad license - I guess applied by its original authors 15 years ago.

Encoder quality setting

Hi.
JJ2000 supports quality settings (bit per pixel at least, and maybe more, like target file size) in the encoder.

Do you think it would be possible to add quality/target size settings to CSJ2K.ToBytes(...)?

Thanks,
Sylvain.

No CSJ2K.dll for WinForms apps in NuGet package

Hi, package available via NuGet does not contain library for WinForms.
I still able to build WinForms dll from sources, but it is less usefull than NuGet package.

Could you please update package to have libraries for all platforms?

How to change output format

I'm currently trying to encode a .ppm file lossless and getting the same file (.ppm) back when decoding. Somehow i always end up with a .png file in the end and have no idea how to change that.

I'm currently doing the encoding and decoding in F#.
This is an example of how the code looks like. I also tried changing the parameters, but the output fileformat didn't change. The picture i got in the last step was always a PNG, while the input was a PPM. I tried different PPM pictures (including the samples from the testfile).

let image = File.OpenRead @"filepath"
let enc = J2kImage.ToBytes(J2kImage.CreateEncodableSource(image2))
File.WriteAllBytes(@"filepath2", enc)

let dec = J2kImage.FromFile(@"filepath2")
let dec2 = dec.As()
dec2.Save(@"filepath3")

Thanks in advance for any help.

JPX decodable images are not rendered properly

Copied from varathuperumal's issue on CodePlex:

JPX decoded images are not processed properly some distortions are there in each tile. Image uses DeviceRGB colorspace. Have attached the stream in this document, kindly process the stream and fix this issue.

Jp2 file with numTiles >1,1

I have a jp2 file which opens correctly in FastStone Image viewer (a scanned document) which renders garbled with the library.

On debugging I have found that numTiles [j2kimage.cs line 221] for this file is not 1,1 dimension and is in fact 2,4

How can this be fixed?

Thanks Mehdi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.