Git Product home page Git Product logo

Comments (5)

ldalzottomp avatar ldalzottomp commented on July 21, 2024 2

I even feel that it's a bug in react-native, because loading the image without even using the camera cause the issue.
I looked for multiple issues on github of people having this issue.
I also realised that I had this issue even before V4.
So, closing the issue. Thanks for your time on this one!

from react-native-vision-camera.

mrousavy avatar mrousavy commented on July 21, 2024

I use BitmapFactory.decodeFile to get the width and height of the photo after capturing.

According to BitmapFactory.Options.outHeight;

The resulting height of the bitmap. If inJustDecodeBounds is set to false, this will be height of the output bitmap after any scaling is applied. If true, it will be the height of the input image without any accounting for scaling.

We set inJustDecodeBounds to true, so this should be "the height of the input image without any accounting for scaling." - does Image.getSize maybe perform display scaling already?

from react-native-vision-camera.

ldalzottomp avatar ldalzottomp commented on July 21, 2024

@mrousavy I tried to debug both source code and didn't any valid conclusion.
I noted indeed that when react load the Image there is a resize done only for the LandscapeLeft picture. (done here in the RN code). But why would it happen only for this orientation ? Other three looks fine. It has to be something else I feel.

The same app login in V3 works fine.

I noted that when react load the exif to get the orientation, I have the following results.


public static final int ORIENTATION_NORMAL = 1;
public static final int ORIENTATION_ROTATE_180 = 3;
public static final int ORIENTATION_ROTATE_270 = 8;
public static final int ORIENTATION_ROTATE_90 = 6;


ORIENTATION_ROTATE_90 -> Portrait
ORIENTATION_ROTATE_NORMAL -> LandscapeLeft
ORIENTATION_ROTATE_180 -> LandscapeRight
ORIENTATION_ROTATE_270 -> PortraitUpsideDown

Which is different from V3 :



ORIENTATION_ROTATE_180 -> LandscapeLeft
ORIENTATION_ROTATE_NORMAL -> LandscapeRight

Exif metadata are read here in react

from react-native-vision-camera.

mrousavy avatar mrousavy commented on July 21, 2024

hmm, interesting. Orientation is still something that's not fully supported (See #1891) - so I don't really have a lot of insights, other than that I'd be confident that CameraX' EXIF writer is probably a bit more battletested than the one I wrote in V3. So V4 should be correct, anything that's incorrect should probably be reported in the Google Issue Tracker, they test on a lot of devices. I only have 3 phones.

from react-native-vision-camera.

ldalzottomp avatar ldalzottomp commented on July 21, 2024

Okay, I will dig more into it and check with a sample CameraX native app. And submit an issue if necessary.
The root cause of this issue may be the same as for #2802

from react-native-vision-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.