Description
In flutter/engine#4762, we added Image.toByteData()
, returning encoded image bytes (jpg, png, or gif).
On Android, where we don't perform LTO in our engine binaries, this change yielded no substantive change in the release binary size. This is because the lack of LTO means that on Android, we're already shipping support for image encoding in the engine binary.
On iOS, however, where we do perform LTO, the linking of image encoding libraries yielded an increase of ~90K.
Rather than returning encoded image bytes in Image.toByteData()
, we should just return unencoded (raw) bytes (RGBA form, row-primary) and leave it up to callers to encode the raw data however they see fit (using something like package:image
or a platform plugin).
flutter/engine#4762 was first released to the dev channel in v0.2.10
, which, as of the time of this writing, has not yet hit the beta
channel. We should fix this issue in time to make the next beta cut, so that we don't have callers start to depend on the API that returns encoded bytes.