Skip to content

Commit

Permalink
Support more image formats on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
ueman committed May 26, 2024
1 parent 7d64419 commit e8281a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static InputImage getInputImageFromData(Map<String, Object> imageData,
(int) (double) metaData.get("width"),
(int) (double) metaData.get("height"),
(int) metaData.get("rotation"),
InputImage.IMAGE_FORMAT_NV21);
(int) imageData.get("image_format"));
return inputImage;
} else {
result.error("InputImageConverterError", "Invalid Input Image", null);
Expand Down
6 changes: 5 additions & 1 deletion packages/google_mlkit_commons/lib/src/input_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ class InputImageMetadata {

/// Format of the input image.
///
/// Not used on Android.
/// Android only supports
/// - [InputImageFormat.nv21]
/// - [InputImageFormat.yuv_420_888]
/// - [InputImageFormat.yv12]
/// as described in [here](https://developers.google.com/android/reference/com/google/mlkit/vision/common/InputImage.ImageFormat).
final InputImageFormat format;

/// The row stride for color plane, in bytes.
Expand Down

0 comments on commit e8281a1

Please sign in to comment.