jaellys / memeify-me

0 stars 7 forks source link

Rotated picture #19

Open hyunj0 opened 9 years ago

hyunj0 commented 9 years ago

Of my group, I'm the only one who has an issue with the bitmap image as it gets rotated from the preview page. When I take/pick a picture, the picture is right-side up but on the edit page, it gets rotated. Did anyone else have this issue?

jaellys commented 9 years ago

Hey Sarah, I have run into this issue as well on my Galaxy S5 running Android 5.0. It's just the way some devices handle a photo (some rotate, some add the orientation information to EXIF data). This discussion on Stack suggests checking for orientation in EXIF data and handling from there:

http://stackoverflow.com/questions/20478765/how-to-get-the-correct-orientation-of-the-image-selected-from-the-default-image

I also found some snippets to remedy the issue on GitHub's Gist website. Definitely seems to be something we can anticipate and handle appropriately.

alizinha commented 9 years ago

Hi, guys. Just FYI but when I take a photo in landscape mode or use a gallery photo that was in landscape mode, my phone (Galaxy Core Prime, running KitKat) simply chops off the left and right sides of that landscape photo and only shows the center.

The stackoverflow link looks very helpful, thanks for that, Jae!

jaellys commented 9 years ago

Allison, I think the cropping you describe is a result of our use of android:scaleType="centerCrop" on line 32 of activity_meme_generator.xml. Photos were initially rendered with aspect ratio maintained, which was problematic (wouldn't fill the parent FrameLayout, areas of saved meme lacking image data would simply be black). I did look up how to deal with empty areas of bitmaps on export, but couldn't work it out in time for our deadline.

Maybe there is a way to allow users to position/scale their imported image (creating their own custom crop) within the FrameLayout. There are a lot of ways we could think about this.