Android5.1的骁龙相机,采用WXGA、vga等Picture size 拍照。在图库中查看照片,照片是正常的。但是当采用MTP模式连接电脑后打开照片看的时候会发现照片局部broken。
修改文件如下:
apps\SnapdragonCamera\src\com\android\camera\Storage.java
1、方法writeFile():
- public static int writeFile(String path, byte[] jpeg, ExifInterface exif,
String mimeType) {
+public static void writeFile(String path, byte[] jpeg, ExifInterface exif,
String mimeType) {
-return exif.writeExif(jpeg, path);
+exif.writeExif(jpeg, path);
-return jpeg.length;
-return 0;
2、方法addImage():
-int size = writeFile(path, jpeg, exif, mimeType);
+writeFile(path, jpeg, exif, mimeType);
return addImage(resolver, title, date, location, orientation,
- size, path, width, height, mimeType);
+ jpeg.length, path, width, height, mimeType);
文章中的“-”就是删掉这行;
“+”就是加上这一行。
重新编译apk。发现问题修复。