cysionliu / imagepicker Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jeasonlzy/imagepicker
仿微信的图片选择,支持AndroidX,适配Android Q
License: Apache License 2.0
This project forked from jeasonlzy/imagepicker
仿微信的图片选择,支持AndroidX,适配Android Q
License: Apache License 2.0
java.lang.OutOfMemoryError: Failed to allocate a 120926912 byte allocation with 25165824 free bytes and 69MB until OOM, max allowed footprint 489109392, growth limit 536870912
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object com.szysky.customize.siv.SImageView.getTag()' on a null object reference at com.szysky.customize.siv.ImageLoader$2.handleMessage(ImageLoader.java:475)
版本:
api 'com.cysion:ImagePicker:1.0.7'
多图选择的时候,点击图片或者右下角的预览,预览不出图片~~使用手机型号:华为p30
系统:Android 9
库版本:1.2.0
裁剪页面,状态栏和TopBar重叠
ImageGridActivity的左上角第一个格拍照按钮呈现全白色 图片与文字资源加载不了
调用jar里面的调用系统相机,拍照之后,会出现2张相同的图片,请问怎么回事
如上
1.0.6版本 出现空指针
java.lang.NullPointerException
Attempt to read from field 'java.lang.String com.lzy.imagepicker.bean.ImageItem.path' on a null object reference
com.lzy.imagepicker.ui.ImageGridActivity.onImageSelected(ImageGridActivity.java:327)
设备机型
华为 HMA AL00
系统版本
Android 9,level 28
ROM
HuaWei/EMOTION
CPU架构
armeabi
设置裁剪框宽高后 在自由裁剪模式没有用
1.先选择相册里面的一张图片,进入到裁剪页面,点击返回到相册列表
2.再拍照确认后,自动调整到裁剪图片页面
3.此时展示裁剪图片,还是之前选择相册里面选择的那张,不是刚才拍照的图片
选中图片时,目前是打勾,是否考虑添加阿拉伯数字排序呢。
选中图片时,能有一个自定义的限制集吗?目前只有数量超限有校验,
可以新增,文件大小校验,图片后缀格式校验,尺寸校验等,返回是否允许选中。
目前的项目中 如果不使用裁剪,好像还没有图片压缩。
Manifest少了一个ImagePreViewBaseActivity,跳转时直接崩溃!!!
压缩逻辑我可以上层处理,不过库里面的 复选框 能显示出来吗?不想fork改代码重build啊。。。
在gridview中调起拍照,老是报这个错误 -Parcelable encountered IOException writing serializable object,发现是ImageGridActivity这个崩溃了,怎么解决?
日志如下
2019-06-10 14:19:44.151 7037-7037/com.exmaple.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xiumei.app, PID: 7037
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.exmaple.app.ui.match.EnrollInActivity$EnrollImageLoader)
at android.os.Parcel.writeSerializable(Parcel.java:1717)
at android.os.Parcel.writeValue(Parcel.java:1665)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:878)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1588)
at android.os.Bundle.writeToParcel(Bundle.java:1233)
at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:3954)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:144)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6815)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Caused by: java.io.NotSerializableException: com.exmaple.app.ui.match.EnrollInActivity
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1240)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1604)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1565)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1488)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1234)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
at android.os.Parcel.writeSerializable(Parcel.java:1712)
at android.os.Parcel.writeValue(Parcel.java:1665)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:878)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1588)
at android.os.Bundle.writeToParcel(Bundle.java:1233)
at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:3954)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:144)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6815)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
解决办法参看https://juejin.im/post/5d80ef726fb9a06aeb10f223,ImageLoader 可以自己修改,但是,FreeCropActivity等其他类里面的,还希望作者修改修改, mSourceUri = Uri.fromFile(new File(mImagePath)); Android 10 是不能正确加载的。
1、可对外提供一个参数,设置:访问图片,访问图片和视频,访问视频;
2、另增加视频时间过滤功能
判断摄像头是否存在为什么使用的是PackageManager.FEATURE_CAMERA 而不是PackageManager.FEATURE_CAMERA_ANY
FEATURE_CAMERA: The device has a camera facing away from the screen(这台设备有一个摄像头,对着屏幕)
FEATURE_CAMERA_ANY: The device has at least one camera pointing in some direction, or can support an external camera being connected to it(设备至少有一个指向某个方向的摄像机,或者可以支持连接到它的外部摄像机)
你好!请问 1.2.0.Q的源码在哪
要不要全部改为 UTF-8 编码啊,现在都是 GB2312
com.cysion:ImagePicker:1.2.0.Q
引用这个适配了AndroidX 了么
相册可以查看视频和图片,选了图片不能选视频,选了视频不能选图片,视频根据长度处理相册中是否显示
看demo的方法,假设我最终要上传给服务器,只能获取到缩略图?
No Activity found to handle Intent { act=android.media.action.IMAGE_CAPTURE flg=0x4000000 }
com.lzy.imagepicker.ImagePicker.takePicture(ImagePicker.java:298)
.NoSuchFieldError: No field mActive of type Landroid/util/SparseArray; in class Landroidx/fragment/app/FragmentManagerImpl; or its superclasses (declaration of 'androidx.fragment.app.FragmentManagerImpl' appears
多选没问题,查看大图也不行
大图显示出来了,然后直接崩溃
日志:
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.locojoy.libros_books.BookApplication$1)
at android.os.Parcel.writeSerializable(Parcel.java:1714)
at android.os.Parcel.writeValue(Parcel.java:1662)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:875)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1583)
at android.os.Bundle.writeToParcel(Bundle.java:1233)
at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:3986)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:144)
at android.os.Handler.handleCallback(Handler.java:891)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:7470)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
Caused by: java.io.NotSerializableException: com.locojoy.libros_books.BookApplication
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1240)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1604)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1565)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1488)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1234)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
at android.os.Parcel.writeSerializable(Parcel.java:1709)
at android.os.Parcel.writeValue(Parcel.java:1662)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:875)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1583)
at android.os.Bundle.writeToParcel(Bundle.java:1233)
at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:3986)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:144)
at android.os.Handler.handleCallback(Handler.java:891)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:7470)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
你好,请问是否可以实现,比如我在不同的地方使用,可以单独配置不同的图片限制数量。
之前我的项目我用了这个项目的前身com.lzy.imagepicker
调用摄像头没有发生过异常
现在我有一个特别小的项目 只是简单的调用摄像头拍照 所以没有引用你的库
问题
在我的项目中 只是简单的拍照+图片上传 在调用摄像头的过程中 有些手机机型抱了crash 也在网上查了许久 但是还是没有解决 请问一下这个问题是怎么导致的呢 谢谢🙏
# main(1)
java.lang.SecurityException
Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.huawei.camera/.ThirdCamera clip={text/uri-list U:content://com.chs.cxrbusinessclient.fileprovider/external_storage_root/Android/data/com.chs.cxrbusinessclient/cache/MyPhoto/20200327152211.png} (has extras) } from ProcessRecord{cb7fbf7 13570:com.chs.cxrbusinessclient/u0a176} (pid=13570, uid=10176) with revoked permission android.permission.CAMERA
// 调用摄像头拍照
case R.id.iv_store_photo:
//权限没有授权,进入授权界面
if (mPermissionsChecker.judgePermissions(PERMISSIONS)) {
ActivityCompat.requestPermissions(this, PERMISSIONS, TAKEPHOTO_REQUEST_CODE);
} else {
takePhotoMethod();
}
break;
// 权限申请回调
onRequestPermissionsResult(){
if (requestCode == TAKEPHOTO_REQUEST_CODE && hasAllPermissionsGranted(grantResults)) {
takePhotoMethod();
} else if (requestCode == TAKEPHOTO_REQUEST_CODE) {
ToastUtils.showShortToast("请手动开启app相机和存储权限");
goIntentSetting();
}
}
// 调起摄像头拍照
String fileName = "";
private void takePhotoMethod() {
fileName = CameraPhotoUtils.getPhotoFileName(this);
// new一个File用来存放拍摄到的照片
File imageFile =new File(fileName);
// 如果存在就删了重新创建
try {
if (imageFile.exists()) {
imageFile.delete();
}
imageFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
// 将存储地址转化成uri对象
if (Build.VERSION.SDK_INT >= 24) {
photoUri = FileProvider.getUriForFile(ApplyBusinessActivity.this, ApplyBusinessActivity.this.getApplicationContext().getPackageName() + ".fileprovider", imageFile);
} else {
photoUri = Uri.fromFile(imageFile);
}
// 设置打开照相的Intent
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
// 设置相片的输出uri为刚才转化的imageUri
intent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);
// 开启相机程序,设置requestCode为TOKE_PHOTO
startActivityForResult(intent, TAKE_PHOTO);
}
/**************相关方法*******************/
// 含有全部的权限
private boolean hasAllPermissionsGranted(int[] grantResults) {
for (int grantResult : grantResults) {
if (grantResult == PackageManager.PERMISSION_DENIED) {
return false;
}
}
return true;
}
// mPermissionsChecker.judgePermissions()
/**
* 判断权限
*/
public boolean judgePermissions(String... permissions) {
for (String permission : permissions) {
if (lacksPermission(permission)) {
return true;
}
}
return false;
}
// 判断是否缺少权限
private boolean lacksPermission(String permission) {
return ContextCompat.checkSelfPermission(mContext, permission) ==
PackageManager.PERMISSION_DENIED;
}
如上
首先说明:我说的自定义比例是自定义固定比例,不是FREE模式下的用户随意变更的比例
新的FreeCrop内有CUSTOM的参数,但是想要自定义宽高比必须重写裁剪的类。为什么不判断当我传的CropMode是CUSTOM的时候,就调取FocusWidth和FocusHeight的宽高比呢?
部分手读取宽高出错,部分手机图片旋转了,导致宽高相反
请问如果想做连续拍照,应该怎么办呢?请指教。
我研究了微信朋友圈拍照后的照片都是保存到腾讯文件夹
P30调取相册异常
手机里面一张图片都没有的时候,拍照按钮不显示(设置了显示拍照的)
图片选择数量限制为1以后,不能再次改变限制数量了
点击+号弹出菜单之后,选择拍照,可以选择拍还是直接返回,不过这个问题这两种情况都会存在。
问题:再次点击+号 选择相册,然后弹出选择相册页面title栏 btnOK不显示,图片上选择框也不显示..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.