git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve cache + jdoc, traces
[fanfix.git]
/
src
/
be
/
nikiroo
/
utils
/
android
/
ImageUtilsAndroid.java
diff --git
a/src/be/nikiroo/utils/android/ImageUtilsAndroid.java
b/src/be/nikiroo/utils/android/ImageUtilsAndroid.java
index ec1c2205af4e7beb2db5f571b39034735ce84ba7..c2e269cc58291cfbcb32d2e105c7d63938c6e136 100644
(file)
--- a/
src/be/nikiroo/utils/android/ImageUtilsAndroid.java
+++ b/
src/be/nikiroo/utils/android/ImageUtilsAndroid.java
@@
-76,9
+76,19
@@
public class ImageUtilsAndroid extends ImageUtils {
try {
Bitmap image = BitmapFactory.decodeStream(stream);
if (image == null) {
try {
Bitmap image = BitmapFactory.decodeStream(stream);
if (image == null) {
+ String extra = "";
+ if (img.getSize() <= 2048) {
+ try {
+ extra = ", content: "
+ + new String(img.getData(), "UTF-8");
+ } catch (Exception e) {
+ extra = ", content unavailable";
+ }
+ }
String ssize = StringUtils.formatNumber(img.getSize());
throw new IOException(
String ssize = StringUtils.formatNumber(img.getSize());
throw new IOException(
- "Failed to convert input to image, size was: " + ssize);
+ "Failed to convert input to image, size was: " + ssize
+ + extra);
}
return image;
}
return image;