log some more exceptions
This commit is contained in:
parent
1a39e58d3c
commit
2eaff99b29
|
@ -677,6 +677,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFrag
|
||||||
try {
|
try {
|
||||||
descriptor = getContentResolver().openAssetFileDescriptor(uri, "r");
|
descriptor = getContentResolver().openAssetFileDescriptor(uri, "r");
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
|
Log.d(TAG, Log.getStackTraceString(e));
|
||||||
// Eat this exception, having the descriptor be null is sufficient.
|
// Eat this exception, having the descriptor be null is sufficient.
|
||||||
}
|
}
|
||||||
if (descriptor != null) {
|
if (descriptor != null) {
|
||||||
|
@ -1037,6 +1038,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFrag
|
||||||
}
|
}
|
||||||
buffer.flush();
|
buffer.flush();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Log.d(TAG, Log.getStackTraceString(e));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return buffer.toByteArray();
|
return buffer.toByteArray();
|
||||||
|
@ -1062,6 +1064,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFrag
|
||||||
try {
|
try {
|
||||||
stream = getContentResolver().openInputStream(item.uri);
|
stream = getContentResolver().openInputStream(item.uri);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
|
Log.d(TAG, Log.getStackTraceString(e));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -486,12 +486,14 @@ public class EditProfileActivity extends BaseActivity {
|
||||||
try {
|
try {
|
||||||
inputStream = contentResolver.openInputStream(uri);
|
inputStream = contentResolver.openInputStream(uri);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
|
Log.d(TAG, Log.getStackTraceString(e));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Bitmap sourceBitmap;
|
Bitmap sourceBitmap;
|
||||||
try {
|
try {
|
||||||
sourceBitmap = BitmapFactory.decodeStream(inputStream, null, null);
|
sourceBitmap = BitmapFactory.decodeStream(inputStream, null, null);
|
||||||
} catch (OutOfMemoryError error) {
|
} catch (OutOfMemoryError error) {
|
||||||
|
Log.d(TAG, Log.getStackTraceString(error));
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
IOUtils.closeQuietly(inputStream);
|
IOUtils.closeQuietly(inputStream);
|
||||||
|
|
|
@ -23,6 +23,7 @@ import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.media.ExifInterface;
|
import android.support.media.ExifInterface;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
@ -32,6 +33,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class DownsizeImageTask extends AsyncTask<Uri, Void, Boolean> {
|
public class DownsizeImageTask extends AsyncTask<Uri, Void, Boolean> {
|
||||||
|
private static final String TAG = "DownsizeImageTask";
|
||||||
private int sizeLimit;
|
private int sizeLimit;
|
||||||
private ContentResolver contentResolver;
|
private ContentResolver contentResolver;
|
||||||
private Listener listener;
|
private Listener listener;
|
||||||
|
@ -100,6 +102,7 @@ public class DownsizeImageTask extends AsyncTask<Uri, Void, Boolean> {
|
||||||
try {
|
try {
|
||||||
inputStream = contentResolver.openInputStream(uri);
|
inputStream = contentResolver.openInputStream(uri);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
|
Log.d(TAG, Log.getStackTraceString(e));
|
||||||
return ExifInterface.ORIENTATION_UNDEFINED;
|
return ExifInterface.ORIENTATION_UNDEFINED;
|
||||||
}
|
}
|
||||||
if (inputStream == null) {
|
if (inputStream == null) {
|
||||||
|
@ -109,6 +112,7 @@ public class DownsizeImageTask extends AsyncTask<Uri, Void, Boolean> {
|
||||||
try {
|
try {
|
||||||
exifInterface = new ExifInterface(inputStream);
|
exifInterface = new ExifInterface(inputStream);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Log.d(TAG, Log.getStackTraceString(e));
|
||||||
IOUtils.closeQuietly(inputStream);
|
IOUtils.closeQuietly(inputStream);
|
||||||
return ExifInterface.ORIENTATION_UNDEFINED;
|
return ExifInterface.ORIENTATION_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue