height and width coming inverted
My image is the size of: Width: 480 Height: 720 and in the getImageProperties method it is inverted
var imageProperties = await FlutterNativeImage.getImageProperties(imagePath);
switch (imageProperties.orientation) {
case ImageOrientation.normal:
case ImageOrientation.rotate180:
case ImageOrientation.flipHorizontal:
case ImageOrientation.flipVertical:
case ImageOrientation.undefined:
// normal size
break;
case ImageOrientation.rotate90:
case ImageOrientation.rotate270:
case ImageOrientation.transpose:
case ImageOrientation.transverse:
// inverted size
break;
}
This is a problem with some Samsung and Sony devices https://github.com/google/cameraview/issues/22
I think it's should be fixed in the package, but for now you can get image size like this:
import 'package:flutter/widgets.dart';
final bytes = await file.readAsBytes();
final image = await decodeImageFromList(await value);
print('${image.width}x${image.height}');
any update .? im stucking this issue
+1 to this issue, experiencing the same thing.
I have started using the "decodeImageFromList" as well and it works without a problem, yet it doesn't have nearly as fast performance as this library provides :) I have an application that I have to process up to 50 images, would be amazing to be able to use this library.