Search code examples
androidorientationuniversal-image-loader

Downloaded images are showing wrong orientation using the Android universal image loader


I used the android universal image loader to download the image If I download the iOS uploaded image then it's showing 270 degree orientation.

If downloaded the s7 edge uploaded images showing 90 degree orientation

If I downloaded the Nexus mobile uploaded images are showing correct orientation

This is code I used to download the images

 ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
            .build();
    ImageLoader.getInstance().init(config);

    options = new DisplayImageOptions.Builder().cacheInMemory(true)
            .cacheOnDisk(true).imageScaleType(ImageScaleType.EXACTLY).build();

 ImageLoader imageLoader = ImageLoader.getInstance();
    imageLoader.displayImage(url, image, options);

please advise to overcome from this issue


Solution

  • first set cacheOnDisk(false) because, It will show the previous image after you changed the code.

    then changed it like this

      options = new DisplayImageOptions.Builder().cacheInMemory(true)
                .considerExifParams(true)
                .cacheOnDisk(true).imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2).build();
    

    This is solved my issue.