flutter_native_image icon indicating copy to clipboard operation
flutter_native_image copied to clipboard

height and width coming inverted

Open matheusperez opened this issue 5 years ago • 4 comments

My image is the size of: Width: 480 Height: 720 and in the getImageProperties method it is inverted

matheusperez avatar Jun 24 '20 23:06 matheusperez

  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;
   }

MagTuxGit avatar Jul 07 '20 07:07 MagTuxGit

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}');

greymag avatar Oct 02 '20 11:10 greymag

any update .? im stucking this issue

CaoGiaHieu-dev avatar Jul 23 '21 05:07 CaoGiaHieu-dev

+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.

UlasAkgun avatar Aug 05 '21 19:08 UlasAkgun