mdsteele / rust-icns

Rust library for encoding/decoding Apple Icon Image (.icns) files
MIT License
24 stars 10 forks source link

Jpeg 2000 Library for rust! #6

Open CharlieS1103 opened 2 years ago

CharlieS1103 commented 2 years ago

https://docs.rs/jp2k/latest/jp2k/ I'm not quite sure how this library works exactly, but from my very limited knowledge of rust, I think this should help?

CharlieS1103 commented 2 years ago

Would it be worth it for me to implement this library and make a PR? Or are you against using it because the maintainer states it is not memory safe?

mdsteele commented 2 years ago

Sure, if you can get it working and write some tests for it, a PR would be very welcome!

CharlieS1103 commented 1 year ago

Haven't quite had the motivation to get started on this, since I'm much less experienced than you, do you believe this would even be possible or nah?

mdsteele commented 1 year ago

Sure, I don't think it should be too hard of a change to make. Ideally the first step would be to find an example of an existing JPEG2000-based ICNS file to test on (although I'm not really sure where to find one). Then you'd want to change https://github.com/mdsteele/rust-icns/blob/master/src/element.rs#L120 to call out to the JPEG2000 library to decode and return the image (instead of returning an error), and then try running the library on your test file (e.g. with cargo run --example icns2png path/to/file.icns).

CharlieS1103 commented 1 year ago

Alright thanks, this gives me some slight security in making this change. I might just be unlucky but the first icns file I tested this application on, contained a jpeg2000 file.

CharlieS1103 commented 1 year ago

I have created https://github.com/CharlieS1103/rust-icns and worked on it a little bit, obviously it's not working quite yet, I'm a bit confused on where to go from here to be entirely honest.

CharlieS1103 commented 1 year ago

Have no idea to test for it, but I think it might function?