You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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).
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.
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.
@raleighlittles I've gotten a little swept up with life, but if I need a distraction from studying for finals I might give it another shot, but honestly it might unfortunately be a lost cause for me.
I found this while working on my app launcher. When trying to parse icons, I noticed that around 1/3rd of icons on my laptop are JPEG 2000. I might add support for this at some point too.
Just found out that the reason for the lack of support for JPEG 2000 was lack of Rust libraries for this format. There's this one now: https://crates.io/crates/jpeg2k
@nukeop Are you aware of whether or not this allows for the conversion of a PNG bundle back into a JPEG 2000? That's the main issue i've been running into
There's an example here that converts between jp2 and j2k using DynamicImage as an intermediary format. I was thinking you could replace jp2 with png and try that?
Activity
CharlieS1103 commentedon Aug 20, 2022
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 commentedon Aug 21, 2022
Sure, if you can get it working and write some tests for it, a PR would be very welcome!
CharlieS1103 commentedon Oct 21, 2022
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 commentedon Oct 22, 2022
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 commentedon Oct 22, 2022
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 commentedon Oct 24, 2022
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 commentedon Oct 25, 2022
Have no idea to test for it, but I think it might function?
raleighlittles commentedon Apr 19, 2025
Any updates on this? @CharlieS1103
CharlieS1103 commentedon Apr 23, 2025
@raleighlittles I've gotten a little swept up with life, but if I need a distraction from studying for finals I might give it another shot, but honestly it might unfortunately be a lost cause for me.
nukeop commentedon Jul 4, 2025
I found this while working on my app launcher. When trying to parse icons, I noticed that around 1/3rd of icons on my laptop are JPEG 2000. I might add support for this at some point too.
nukeop commentedon Jul 4, 2025
Just found out that the reason for the lack of support for JPEG 2000 was lack of Rust libraries for this format. There's this one now: https://crates.io/crates/jpeg2k
CharlieS1103 commentedon Jul 10, 2025
@nukeop Are you aware of whether or not this allows for the conversion of a PNG bundle back into a JPEG 2000? That's the main issue i've been running into
nukeop commentedon Jul 10, 2025
You can convert a PNG into DynamicImage, then it lets you save a DynamicImage as JPEG 2000.
CharlieS1103 commentedon Jul 12, 2025
@nukeop Are you sure? I didn't see anything about that in that libraries documentation
nukeop commentedon Jul 12, 2025
https://github.com/Neopallium/jpeg2k/blob/d475d0c2a8cdb13f5bb11342623213bebf80a521/examples/convert_jp2.rs#L6
There's an example here that converts between jp2 and j2k using DynamicImage as an intermediary format. I was thinking you could replace jp2 with png and try that?