使用 gl-react-image 旋转图像

Rotation of image with gl-react-image

为什么我的图片旋转了?

以下尺寸:

               Object {
13:06:33 [exp]   "height": 3264,
13:06:33 [exp]   "uri": "file:///var/mobile/Containers/Data/Application/8196F3EA-3555-476F-B70F-E76CBBFBB3F8/Library/Caches/ExponentExperienceData/%2540devlyl%252Flyl/Camera/5FA1D6E2-D99E-4675-AF6E-CB96A2367015.jpg",
13:06:33 [exp]   "width": 1836,
13:06:33 [exp] }

相机拍摄结果: https://imgur.com/a/I152DXU

用GLImage显示: https://imgur.com/a/PL7EumH

相关 github 问题:https://github.com/gre/gl-react-image/issues/22

编辑 1:

我找到了使用 react-native-gl 制作 intagram 过滤器的相关教程:

https://www.youtube.com/watch?v=AMAJLgafs6U

可能的解决方案如以下所述:github.com/gre/gl-react-image/issues/22

I had an issue similar to this and I fixed it by resizing the image before passing it as a uniform. Although I was using just the standard Node from "gl-react" not "gl-react-image".
3264 x 1836 is pretty big so I assume this is your issue also. Try halving this.
Can be done on expo with https://docs.expo.io/versions/latest/sdk/imagemanipulator/

对于非 Expo 用户,可以通过以下方式调整图像大小:bamlab/react-native-image-resizer