E edgar_ortiz Active Member Licensed User Longtime User Mar 20, 2017 #1 Hi, I have a problem with image handling. I Use "camera tutorial" and I take a photo and it generates a file of almost 2MB... That's OK. Now I need to compress the file ... which does well ... with the only problem that changes the orientation of the image. Any help is welcome. Regards, Edgar P.S.: By the way ... the original image incorrectly reports the width and height (you can see it in the log) ** Service (starter) Create ** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** findCamera null 2 facing: 0, 0 findCamera 0 2 facing: 0, 0 90 [Height=720, IsInitialized=false, Width=1280 ] Original Image (0_59.jpg) Height: 3096 Width: 4128 New Image (0_59.jpg) Height: 600 Width: 800 ** Activity (main) Pause, UserClosed = true ** Click to expand... NOTE: The picture is vertical (Height: 4128 and Width: 3096) Attachments Camera_Test.zip 12.7 KB · Views: 230
Hi, I have a problem with image handling. I Use "camera tutorial" and I take a photo and it generates a file of almost 2MB... That's OK. Now I need to compress the file ... which does well ... with the only problem that changes the orientation of the image. Any help is welcome. Regards, Edgar P.S.: By the way ... the original image incorrectly reports the width and height (you can see it in the log) ** Service (starter) Create ** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** findCamera null 2 facing: 0, 0 findCamera 0 2 facing: 0, 0 90 [Height=720, IsInitialized=false, Width=1280 ] Original Image (0_59.jpg) Height: 3096 Width: 4128 New Image (0_59.jpg) Height: 600 Width: 800 ** Activity (main) Pause, UserClosed = true ** Click to expand... NOTE: The picture is vertical (Height: 4128 and Width: 3096)
Erel B4X founder Staff member Licensed User Longtime User Mar 20, 2017 #2 edgar_ortiz said: Now I need to compress the file ... which does well ... with the only problem that changes the orientation of the image. Click to expand... It is not the saving process that changes the orientation, you see that image as it is returned from the camera. You need to read the orientation from the EXIF header and rotate the image. You can see an example here: https://www.b4x.com/android/forum/t...ibrary-functionality.23801/page-4#post-151355 Upvote 0
edgar_ortiz said: Now I need to compress the file ... which does well ... with the only problem that changes the orientation of the image. Click to expand... It is not the saving process that changes the orientation, you see that image as it is returned from the camera. You need to read the orientation from the EXIF header and rotate the image. You can see an example here: https://www.b4x.com/android/forum/t...ibrary-functionality.23801/page-4#post-151355