Skip to content

Jpeg 2000 Library for rust! #6

@CharlieS1103

Description

@CharlieS1103

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?

Activity

CharlieS1103

CharlieS1103 commented on Aug 20, 2022

@CharlieS1103
Author

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

mdsteele commented on Aug 21, 2022

@mdsteele
Owner

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

CharlieS1103

CharlieS1103 commented on Oct 21, 2022

@CharlieS1103
Author

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

mdsteele commented on Oct 22, 2022

@mdsteele
Owner

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

CharlieS1103 commented on Oct 22, 2022

@CharlieS1103
Author

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

CharlieS1103 commented on Oct 24, 2022

@CharlieS1103
Author

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

CharlieS1103 commented on Oct 25, 2022

@CharlieS1103
Author

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

raleighlittles

raleighlittles commented on Apr 19, 2025

@raleighlittles

Any updates on this? @CharlieS1103

CharlieS1103

CharlieS1103 commented on Apr 23, 2025

@CharlieS1103
Author

@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

nukeop commented on Jul 4, 2025

@nukeop

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

nukeop commented on Jul 4, 2025

@nukeop

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

CharlieS1103 commented on Jul 10, 2025

@CharlieS1103
Author

@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

nukeop commented on Jul 10, 2025

@nukeop

You can convert a PNG into DynamicImage, then it lets you save a DynamicImage as JPEG 2000.

CharlieS1103

CharlieS1103 commented on Jul 12, 2025

@CharlieS1103
Author

@nukeop Are you sure? I didn't see anything about that in that libraries documentation

nukeop

nukeop commented on Jul 12, 2025

@nukeop

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mdsteele@raleighlittles@nukeop@CharlieS1103

        Issue actions

          Jpeg 2000 Library for rust! · Issue #6 · mdsteele/rust-icns