News for hackers. Stuff that matters.
Re:Jpegli: A New JPEG Coding Library by Sesse__ on Wednesday April 03, 2024 @04:25PM (#39922621)
Wuffs is for the exact _opposite_ purpose (decoding). It can do simple encoding once you know what bits to put in the file, but a JPEG encoder contains a lot of nontrivial machinery that does not fit well into Wuffs.

(I work at Google, but have nothing to do with Jpegli or Wuffs)

Re:Jpegli: A New JPEG Coding Library by nigeltao on Wednesday April 03, 2024 @06:52PM (#39924365)
Encoding is definitely in Wuffs' long term objectives (it's issue #2 and literally in its doc/roadmap.md file). It's just that decoding has been a higher priority. It's also a simpler problem. There's often only one valid decoding for any given input.

Decoding takes a compressed image file as input, which have complicated formats. Roughly speaking, encoding just takes a width x height x 4 pixel buffer, with very regular structure. It's much easier to hide something malicious in a complicated format.

Higher priority means that, when deciding whether to work on a Wuffs PNG encoder or a Wuffs JPEG decoder next, when neither existed at the time, I chose to have more decoders.

(I work at Google, and am the Wuffs author, but have nothing to do with Jpegli. Google is indeed a big company.)

Re:Jpegli: A New JPEG Coding Library by littlestymaar on Thursday April 04, 2024 @01:51AM (#39926986)
Thanks for the answer!
Re:Jpegli: A New JPEG Coding Library by Hackbraten on Wednesday April 03, 2024 @04:39PM (#39922789)
The first paragraph in Wuffs's README explicitly states that it's good for both encoding and decoding?
Re:Jpegli: A New JPEG Coding Library by Sesse__ on Wednesday April 03, 2024 @05:05PM (#39923132)
No, it states that wrangling _can be_ encoding. It does not in any way state that Wuffs is actually _good_ for it at the current stage, and I do not know of any nontrivial encoder built with Wuffs, ever. (In contrast, there are 18 example decoders included with Wuffs. I assume you don't count the checksum functions as encoding.)