Add a comment in Image.toByteData to limit more encoders (flutter/engine#29962)
This commit is contained in:
@@ -1574,6 +1574,10 @@ class Paint {
|
||||
|
||||
/// The format in which image bytes should be returned when using
|
||||
/// [Image.toByteData].
|
||||
// We do not expect to add more encoding formats to the ImageByteFormat enum,
|
||||
// considering the binary size of the engine after LTO optimization. You can
|
||||
// use the third-party pure dart image library to encode other formats.
|
||||
// See: https://github.com/flutter/flutter/issues/16635 for more details.
|
||||
enum ImageByteFormat {
|
||||
/// Raw RGBA format.
|
||||
///
|
||||
@@ -1715,6 +1719,10 @@ class Image {
|
||||
///
|
||||
/// Returns a future that completes with the binary image data or an error
|
||||
/// if encoding fails.
|
||||
// We do not expect to add more encoding formats to the ImageByteFormat enum,
|
||||
// considering the binary size of the engine after LTO optimization. You can
|
||||
// use the third-party pure dart image library to encode other formats.
|
||||
// See: https://github.com/flutter/flutter/issues/16635 for more details.
|
||||
Future<ByteData?> toByteData({ImageByteFormat format = ImageByteFormat.rawRgba}) {
|
||||
assert(!_disposed && !_image._disposed);
|
||||
return _image.toByteData(format: format);
|
||||
|
||||
Reference in New Issue
Block a user