Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

https://github.com/libjxl/jxl-rs jxl-rs is the underlying implementation. It's relatively new but Rust certainly calms security fears. This library wasn't really an option last time this came around in chromium.


Didn't Google refuse adding JpegXL because they claimed there wasn't enough interest? I don't think they refused out of security concerns but maybe I'm misremembering that.


Google argued that duplicating largely (I know JpegXL does support a bit more, but from most users' perspectives, they're largely right) what AVIF provided while being written in an unsafe language was not what they wanted in terms in increasing the attack surface.


And it really was the right move at the time, imo. JXL however now has better implementations and better momentum in the wider ecosystem and not just yet another image format that gets put into chrome and de facto becomes a standard.




Hahaha perfect! Can't believe I never heard this story before.


I can confirm. I found multiple problems in the "official" cjxl encoder back in 2023 contrary to the webp2 (cwp2) implementation where I could not find any bug or error.

If the encoder have obvious problems it is not a big deal, but it doesn't bode well for the decoder.


CVE-2023-0645 in libjxl that year too, and several since


It's also a horrible API. Will start working on the rust lib then. Hopefully it's better, because I really want to use it.


Forcing other companies to override them is a way to prove momentum but it's not a good way to prove momentum.


> duplicating largely what AVIF provided

That's not a great bar since both of them showed up around the same time. And importantly JXL hits many use cases that AVIF doesn't.

> while being written in an unsafe language

They put little emphasis on that part when they were rejecting JXL. If they wanted to call for a safer implementation they could have done that.


Google refused to merge JpegXL as a strategy play to promote AVIF, which was in use by other teams (i think Photos?). Internally, chrome engineers were supportive of jxl but were overridden by leadership.


Do you have actual sources for this? Because the other people commenting about how the newer library removes most of the concerns explains this better than an unsubstantiated speculation about promoting AVIF.


If you look at the issue tracker, the creator of Webp killed it because of untrue claims there was no interest or advantages over existing formats.

Concerns about the implementation only came up after years of pushback forced google ton reconsider.


> If you look at the issue tracker, the creator of Webp killed it because of untrue claims

I think for most modern software it's difficult to name the creator, but if you had to for webp, it would be hard to argue that it's anyone but Jyrki Alakuijala, who is in fact one of the co-creators of jpegxl and the person backing up the long-term support of the rust jxl-rs implementation, so I'm not even going to ask for a source here because it's just not true.


AFAIK Jyrki came after WebP was already announced to add lossless support; rather I’d consider Skal the creator inasmuch as it was originally just an image container for VP8 intra. He was working on WebP2 at the time Google rejected JPEG-XL and also was not involved in that decision.


I designed the lossless format and its initial encoder. Zoltán Szabadka wrote the initial lossless decoder.

On2 Technologies had designed the lossy format and its initial encoder/decoder. Skal improved on the encoder (rewriting it for better quality, inventing workarounds for the YUV420 sampling quality issues), but did not change the format's image-related aspects that On2 Technologies had come up with for VP8 video use.

In the end stage of lossless productization (around February 2012) Skal had minor impact on the lossless format:

1. He asked it to have the same size limitations (16383x16383 pixels) like lossy.

2. He wanted to remove some expressivity for easier time for hardware implementations, perhaps a 0.5 % hit on density.

Skal also took care of integrating the lossless format into the lossy as an alpha layer.


>so I'm not even going to ask for a source here because it's just not true.

Well it is up to you to decide. The link was submitted a dozen of times on HN and the whole thing was well reported. And Jyrki Alakuijala already classify its creator status.


It's been 3 years, I might have people mixed up, but that was the justification at the time.


Bug tracker where they lied about "not enough interest".


>an unsubstantiated speculation about promoting AVIF.

They deliberately made up a flawed test to show AVIF is better than JPEG XL. When most evidences shows contrary.


> It's relatively new but Rust certainly calms security fears.

https://github.com/search?q=repo%3Alibjxl%2Fjxl-rs%20unsafe&...


That looks pretty good to me. Every `unsafe` function has clearly stated safety requirements, and every `unsafe` blocks justifies why the requirements are met.


So, I had no reason to use "unsafe" for a very long time, and had developed a bit of an aversion to it. Then I actually needed to use it, first to interface with some C code, and then to deal with a device's mmap'd memory as raw `&[u8]`s.

And my discovery (which basically anyone could have told me beforehand) was that ... "unsafe" rust is not really that different from regular rust. It lets you dereference pointers (which is not a particularly unusual operation in many other languages) and call some functions that need extra care. Usually the presence of "unsafe" really just means that you needed to interface with foreign functions or hardware or something.

This is all to say: implying that mere presence of an "unsafe" keyword is a sign that code is insecure is very, very silly.


> Rust certainly calms security fears

No, memory safety is not security, Rust's memory guarantees eliminate some issues, but they also create a dangerous overconfidence, devs treat the compiler as a security audit and skip the hard work of threat modeling

A vigilant C programmer who manually validates everything and use available tools at its disposal is less risky than a complacent Rust programmer who blindly trust the language


> A vigilant C programmer who manually validates everything and use available tools at its disposal is less risky than a complacent Rust programmer who blindly trust the language

I agree with this. But for a component whose job is to parse data and produce pixels, the security worries I have are memory ones. It's not implementing a permissions model or anything where design and logic are really important. The security holes an image codec would introduce are the sort where it a buffer overun gave an execution primitive (etc.).


Rust programmers are far more likely to have the vigilant mindset than C programmers, or they wouldn't be using Rust.

You can get an awful lot done very quickly in C if you aren't bothered about security - and traditionally, most of the profession has done exactly that.


> A vigilant C programmer who manually validates everything and use available tools at its disposal is less risky than a complacent Rust programmer who blindly trust the language

What about against a vigilant Rust programmer who also manually validates everything and uses available tools at its disposal?


History shows that either vigilance of most C programmers is not enough, or they are not vigilant at all. C/C++ and RCE via some buffer overflow is like synonyms.


> A vigilant C programmer who manually validates everything

So, a fairy-tale character?


I can't believe someone is still using this argument. Is this sarcasm?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: