picture on canvas turned by 90° with PhotoBooth

329 views
Skip to first unread message

Horst Schulze

unread,
Jan 12, 2019, 6:39:21 AM1/12/19
to MIT App Inventor Forum

Hi
trying Photobooth I found the pictures are turned. I took in portrait orientation and they arrived in landscape,
I want to see the portrait picture in a portrait canvas


So how turning them. In Canvas and photo there seems no tool for it.

Horst

TimAI2

unread,
Jan 12, 2019, 7:56:23 AM1/12/19
to MIT App Inventor Forum
Try Taifun's excellent image extension, there is a rotate function

Chris Ward

unread,
Jan 12, 2019, 1:20:22 PM1/12/19
to MIT App Inventor Forum
Hi Horst

Of interest........

ImageRotateBlock.png


Horst Schulze

unread,
Jan 12, 2019, 3:03:27 PM1/12/19
to MIT App Inventor Forum
Ah!
But I assigned it to a canvas, I'll try with image.
Horst

Horst Schulze

unread,
Jan 12, 2019, 3:18:43 PM1/12/19
to MIT App Inventor Forum
Yes, but I don't want to make photoshop but only to have the picture.
I try with the image advice of Chris cause I need not to tap the picture in my app.
Perhaps later.

Evan Patton

unread,
Jan 14, 2019, 10:44:17 AM1/14/19
to MIT App Inventor Forum
Hi Horst,

If the image isn't sensitive in nature, would you mind emailing to me? I have heard other reports on occasion and want to run some tests. My guess is that the camera app used to take the picture is storing the rotation information in the EXIF data, and we aren't taking this into account when we read it in. If so, we might be able to make App Inventor more robust to this in the future.

Regards,
Evan

Zimbu

unread,
Jan 14, 2019, 8:33:19 PM1/14/19
to MIT App Inventor Forum
Hi Evan,

This problem seems to happen with Samsung and LG smartphones. I think you are right that the phone is storing the rotation info in some sort of non-standard way. 

For my app, it does not matter. I simply added a 270 degree auto-rotate (using Taifun's extension) in the blocks after taking the photo. My app will only run on a dedicated LG phone, so this "hard" way of fixing the problem is OK for me. 

But I think this is still a big problem for others who plan to widely distribute their app and have it run smoothly of many different brands of smartphones. 

Several people in this forum have suggested adding a rotation button to these apps to solve this problem. While helpful, that is not a very elegant solution in my view; it leaves the burden on the user to manually rotate a photo image whereas the user would rightly expect this to be handled automatically by the app. 

Just my two cents.

Zimbu

Hossein Amerkashi

unread,
Jan 15, 2019, 9:24:36 AM1/15/19
to MIT App Inventor Forum
PhotoBooth app uses the Camera component. This component invokes the the underlying device Camera app. The Camera app that is used stores picture meta data (as mentioned by Evan) along with picture. The EXIF data includes such data as date/time, white-balance, picture rotation (e.g. landscape/portrait), etc. After a picture is taken, the pictures are all saved in a specific layout (as far as I know). Using the Camera app, when you click on a thumbnail picture, the app reads the exif data to determine how the picture was taken (landscape vs. portrait). At that time, the app opens and displays the picture in the orientation that it was taken.

Having said above, the PhotoBooth doesn't read the exif data and just displays picture in the Camera app default layout. This is why on some devices it may look correct orientation, on other wrong orientation.

-Hossein.

Horst Schulze

unread,
Jan 15, 2019, 4:07:41 PM1/15/19
to MIT App Inventor Forum
Hi Zimbu and Evan,

Yes I have a Samsung phone. It seems that this is the problem with it.

I think it coulf be solved if you give to camera1.afterPicture not only the addres of the picture but too the exif Data specially the orientation.

Horst
Bild2.jpg

Zimbu

unread,
Jan 15, 2019, 4:17:53 PM1/15/19
to MIT App Inventor Forum
Hi Horst,

I'm not sure if that will solve it though. Let's say you could know from the EXIF data that the photo had dimensions 1000 x 1500, and you also knew that it was taken in portrait mode. OK, so clearly you should orient the picture with 1500 being the height and 1000 being the width. BUT, there are TWO edges of the photo that are 1000 long...which is the top of the photo, and which is the bottom??? Without knowing that, you might show the picture flipped upside down on some phones.

(Caveat: I'm a tech idiot, so perhaps my understanding is completely wrong. Maybe there really is some way to know from the EXIF data which 1000 edge is the top and which is the bottom.)

Zimbu

Horst Schulze

unread,
Jan 18, 2019, 5:39:23 AM1/18/19
to mitappinv...@googlegroups.com

Horst Schulze

unread,
Jan 21, 2019, 6:24:49 AM1/21/19
to MIT App Inventor Forum
Another
Both shows with Taifun.IsLandscape true
Reply all
Reply to author
Forward
0 new messages