Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoCorrectionAngle switches image width and height #62

Closed
gtrochimiuk opened this issue Jun 28, 2019 · 2 comments · Fixed by #64
Closed

autoCorrectionAngle switches image width and height #62

gtrochimiuk opened this issue Jun 28, 2019 · 2 comments · Fixed by #64
Labels
type: bug Something isn't working

Comments

@gtrochimiuk
Copy link

I am using this library to compress an in-memory image to a certain width:

final compressedBytes = await FlutterImageCompress.compressWithList(
      bytes,
      minWidth: targetWidth,
      minHeight: 0,
    );

On some Android devices (i.e. Samsung Galaxy S6) I have a problem with resulting image size - height is equal to targetWidth and width is scaled to keep the aspect ratio.

I think that the problem is caused by autoCorrectionAngle - it rotates the image to keep orientation (which is what I want), but it does not adjust width and height values to the rotation.

Would it be possible to change the behaviour of auto correcting orientation to also switch width with height if needed, so that resulting image width is equal to targetWidth I specify? If not - is there a way for me to know which image will be rotated by autoCorrectionAngle = true so that I can specify a targetHeight instead of targetWidth to achieve the same result?

@CaiJingLong
Copy link
Member

There is no way to know the current version.
Because the direction information comes from ExifInterface, an Android native interface, it is not exposed on the dart side.

@CaiJingLong
Copy link
Member

So I should modify the order of minWidth and autoCorrectionAngle so that this property takes effect before minWidth, not after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
2 participants