【发布时间】:2021-06-20 18:50:31
【问题描述】:
我在 Android Studio 中使用 Java Google Drive API 从驱动器下载图像:
OutputStream outputStream = new FileOutputStream(mContext.getFilesDir() + "/" + destPath);
mDriveService.files().get(id).executeMediaAndDownloadTo(outputStream);
大多数图像都能正常保存在设备上(就像驱动器上的原始图像一样)。但有些图片会旋转保存。
我的意思是,例如,我在谷歌驱动器上有一张以纵向模式定向的照片。但是上面的代码下载到设备上后,设备上的照片是横向的。
【问题讨论】:
-
原件和复印件的文件大小(以字节为单位)如何?
-
the photo on the device is in landscape mode.你在哪里看到它显示?通过哪个应用程序? -
显然下载的图像在下载时没有旋转,但在执行此操作时会旋转: Bitmap myBitmap = BitmapFactory.decodeFile(tmpImgFile.getAbsolutePath()); imageView.setImageBitmap(myBitmap);
标签: java android android-studio google-drive-api google-drive-android-api