linebender / piet

An abstraction for 2D graphics.
Apache License 2.0
1.24k stars 93 forks source link

Update `image` to `0.24` #494

Closed avitex closed 2 years ago

avitex commented 2 years ago

An allocation has been removed for writing a PNG data-url in piet-svg.

Rather than going through DynamicImage::write_to, we just take the bytes and write directly with PngEncoder. This is due to write_to now requiring an io::Seek constraint which EncoderStringWriter does not implement.

Note PngEncoder::encode is now deprecated, with a note pointing to ImageEncoder::write_image instead. Note also that ImageEncoder::write_image expects image buffers with color types with 16-bit per channel or larger to be native endian, which differs to the semantics of PngEncoder::encode.

cmyr commented 2 years ago

@avitex you may need to rebase this on master to pass CI, I've fixed an issue that was causing it to fail.

avitex commented 2 years ago

@cmyr done :)

avitex commented 2 years ago

@cmyr Pushed up a change to fix the previous run