Piasy / BigImageViewer

Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling Scale Image View, Fresco, Glide, and Picasso. Even with gif and webp support! 🍻
MIT License
3.98k stars 400 forks source link

I used Glide to load image, the image is being rotated #154

Closed cai9311 closed 5 years ago

cai9311 commented 5 years ago

The link is http://wefootball.oss-cn-shanghai.aliyuncs.com/upload/backend/2019-06-06/94f44a8ff7e245bf9025aa6b4e699a32.jpg When I used GlideImageLoader,Is is rotated.

Piasy commented 5 years ago

@cai9311 That should be a SSIV issue, please file an issue here with the sample image link.

DennyWeinberg commented 5 years ago

I did that:

            photoView.setImageLoaderCallback(new ImageLoader.Callback() {
                @Override
                public void onCacheHit(int imageType, File image) {
                    photoView.getSSIV().setOrientation(ORIENTATION_USE_EXIF);
                }

                @Override
                public void onCacheMiss(int imageType, File image) {

                }

                @Override
                public void onStart() {

                }

                @Override
                public void onProgress(int progress) {

                }

                @Override
                public void onFinish() {

                }

                @Override
                public void onSuccess(File image) {

                }

                @Override
                public void onFail(Exception error) {

                }
            });

Just for information

Piasy commented 5 years ago

@DennyWeinberg You should move your code into onFinish or onSuccess, although GlideLoader won't fire onCacheMiss, which means onCacheHit could work.

DennyWeinberg commented 5 years ago

I use a custom Glide Loader so it worked in my case because I call onCacheHit manually...

hereisderek commented 5 years ago

I don't really understand why not extracting the orientation automatically when first load.