main
Matthew 8 months ago
parent 3714d08296
commit ce8972f584

@ -14,6 +14,7 @@
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:requestLegacyExternalStorage="true"
android:theme="@style/MaterialTheme">
<activity
android:name=".MainActivity"

@ -497,7 +497,7 @@ public class Camera2RawFragment extends Fragment
String currentDateTime = generateTimestamp();
File jpegFile = new File(Environment.
getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),
"IMG_" + currentDateTime + ".jpg");
"Camera/IMG_" + currentDateTime + ".jpg");
// Look up the ImageSaverBuilder for this request and update it with the file name
// based on the capture start time.
@ -524,7 +524,7 @@ public class Camera2RawFragment extends Fragment
if (jpegBuilder != null) {
jpegBuilder.setResult(result);
sb.append("Saving JPEG as: ");
sb.append("保存于: ");
sb.append(jpegBuilder.getSaveLocation());
}
@ -714,7 +714,7 @@ public class Camera2RawFragment extends Fragment
// For still image captures, we use the largest available size.
Size[] resolutions = map.getHighResolutionOutputSizes(ImageFormat.JPEG);
if (resolutions == null) {
if (resolutions == null || resolutions.length == 0) {
resolutions = map.getOutputSizes(ImageFormat.JPEG);
}
Size largestJpeg = Collections.max(Arrays.asList(resolutions), new CompareSizesByArea());
@ -1028,7 +1028,7 @@ public class Camera2RawFragment extends Fragment
// For still image captures, we always use the largest available size.
Size[] resolutions = map.getHighResolutionOutputSizes(ImageFormat.JPEG);
if (resolutions == null) {
if (resolutions == null || resolutions.length == 0) {
resolutions = map.getOutputSizes(ImageFormat.JPEG);
}
Size largestJpeg = Collections.max(Arrays.asList(resolutions), new CompareSizesByArea());

Loading…
Cancel
Save