File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,17 @@ extension CameraImageToInputImage on CameraImage {
4747 if (planes.isEmpty) {
4848 return null ;
4949 }
50- Plane plane = planes.first;
5150
5251 // compose InputImage using bytes
5352 return InputImage .fromBytes (
54- bytes: plane.bytes,
53+ bytes: Uint8List .fromList (
54+ planes.fold ([], (previousValue, element) => previousValue..addAll (element.bytes)),
55+ ),
5556 metadata: InputImageMetadata (
56- size: Size ((plane. width ?? width).toDouble (), (plane .height ?? height).toDouble ()),
57+ size: Size ((planes.first. width ?? width).toDouble (), (planes.first .height ?? height).toDouble ()),
5758 rotation: rotation, // used only in Android
5859 format: format, // used only in iOS
59- bytesPerRow: plane .bytesPerRow, // used only in iOS
60+ bytesPerRow: planes.first .bytesPerRow, // used only in iOS
6061 ),
6162 );
6263 }
You can’t perform that action at this time.
0 commit comments