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.
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 withPngEncoder
. This is due towrite_to
now requiring anio::Seek
constraint whichEncoderStringWriter
does not implement.Note
PngEncoder::encode
is now deprecated, with a note pointing toImageEncoder::write_image
instead. Note also thatImageEncoder::write_image
expects image buffers with color types with 16-bit per channel or larger to be native endian, which differs to the semantics ofPngEncoder::encode
.