mdsami / android-query

Automatically exported from code.google.com/p/android-query
0 stars 0 forks source link

Auto rotate images that have exif data #62

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load an image with exif data that describes the rotation of the image 
2. See that the image is not rotated in the imageview

What is the expected output? What do you see instead?
-The image should be rotated according to the exif data

Please provide any additional information below.
-A lot of cameras on android devices do not rotate the image if it is taken in 
portrait, instead they simple put exif data inside of the image to indicate it 
should be rotated. On these phones, you can't use aquery to load images and 
have them displayed correctly.

This might be better as a flag to turn on and off as the image rotation will 
certainly use more memory and processing time.

Original issue reported on code.google.com by imbeyond...@gmail.com on 13 Jul 2012 at 1:49

GoogleCodeExporter commented 8 years ago

Original comment by tinyeeliu@gmail.com on 15 Jul 2012 at 6:25

GoogleCodeExporter commented 8 years ago
0.25.4-beta is released with beta auto rotate feature:

http://code.google.com/p/android-query/downloads/list

By default it is turned off, to use rotate you will need to use 
BitmapAjaxCallback.

Please let me know if it's working properly on your app. :)

Sample code:

    public void image_auto_rotate(){

        String imageUrl = "http://res.dbkon.co.kr/resource/201302091360376386575001.jpg";            

        BitmapAjaxCallback cb = new BitmapAjaxCallback();

        //target width is necessary, the rotation will recreate the bitmap which can cause OOM issue if image is too large
        cb.url(imageUrl).targetWidth(300).rotate(true);

        aq.id(R.id.image).image(cb);

    }

Original comment by tinyeeliu@gmail.com on 20 Feb 2013 at 6:29