I am wondering is it possible to rotate an image stored on sdcard without loading it’s to memory.
The reason is why I am looking for that is famous OutOfMemoryError. I know I can avoid it by downsampling large image but in fact I don’t want to reduce size of that image, I want to have original image but rotated on 90 degrees.
Any suggestions about that are warmly appreciated 🙂
you should decode decode the images using
Bitmap. you should follow Loading Large Image presented by google on how to do it.. it helped me alot, you’ll notice the large difference in the RAM usage..UPDATE if all you want is just rotate the image you can use this code
if you just need to set the image orientation (for example the photo orientation when it’s was taken) you can use
with the attribute
ExifInterface.TAG_ORIENTATIONI hope this helps you