图库中存在8000X8000的图片导致应用直接退出
来源:互联网 发布:淘宝组装机 知乎 编辑:程序博客网 时间:2024/04/30 10:18
在MediaProvider中过滤这张图片
if ((initialValues != null) && (match == IMAGES_MEDIA)) {
String path = initialValues.getAsString(MediaStore.MediaColumns.DATA);
if(path != null)
{
MediaFile.MediaFileType mediaFileType = MediaFile.getFileType(path);
int fileType = (mediaFileType == null ? 0 : mediaFileType.fileType);
if (MediaFile.isImageFileType(fileType)) {
BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();
bitmapOptions.inSampleSize = 1;
bitmapOptions.inJustDecodeBounds = true;
bitmapOptions.outWidth = 0;
bitmapOptions.outHeight = 0;
BitmapFactory.decodeFile(path, bitmapOptions);
long px = bitmapOptions.outWidth * bitmapOptions.outHeight;
if(px > 4092 * 4092) {
//unsupport image is not inserted
Log.e(TAG, "find huge/unsupport image, path = " + path + ", mWidth = " + bitmapOptions.outWidth + ", mHeight = " + bitmapOptions.outHeight);
return null;
}
}
}
}
- 图库中存在8000X8000的图片导致应用直接退出
- 存在数据库里的图片直接显示到PictureBox中
- android中直接退出整个应用的方法
- android 调用图库中选择的图片
- 应用直接退出
- 对图片裁剪框架 ucrop 的二次封装的工具类,添加从图库选择和拍照获取图片,项目中可直接使用,十分便捷
- 项目中异常退出导致的问题。
- 图片不存放文件夹,直接存在数据库中,
- 从android系统图库中取图片的代码
- 从android系统图库中取图片的代码
- Android从系统图库中读取选择后的图片
- Android中 调用图库 选择 图片的参数理解
- 从android系统图库中取图片的代码
- 从android系统图库中取图片的代码
- Android 开发中下载的图片 图库中看不到
- Android从系统图库中选择图片的源代码
- Android中 调用图库选择图片的参数详解
- Android 使保存的图片在图库中显示
- strtok和strtok_r字符串分割
- javascript常用方法函数收集
- 微乐
- linux vim快捷键大全 速查
- [转] IOS推送 最详细 最正确的一版
- 图库中存在8000X8000的图片导致应用直接退出
- 高并发量网站解决方案
- Dom4j 根据指定的节点属性获取节点内容
- php 无限级分类
- JPA学习笔记
- 一个简单的自定义数字验证
- Scala初次接触
- 渣基础:比照Hawstein学Cracking the coding interview(1)
- Difference between CLOCK_REALTIME and CLOCK_MONOTONIC