PictureSelector icon indicating copy to clipboard operation
PictureSelector copied to clipboard

图片选择问题

Open 15929721851 opened this issue 3 years ago • 0 comments

Current use version?

当前使用的版本是多少?

3.0.9 华为p30鸿蒙2.0


Will this problem occur in demo?

Demo能否复现这问题?

能,一旦出现第一次就会频发


Describe the problem or provide an error log?

描述问题或提供错误log?

反复选择图片情况下 PictureFileUtils.createFilePath(ctx, "", mineType, customFileName);和PictureContentResolver.getContentResolverOpenInputStream(ctx, Uri.parse(url));偶尔会执行缓慢,大概1-2分钟,但是能执行成功

public static String copyPathToSandbox(Context ctx, String url, String mineType, String customFileName) { try { InputStream inputStream; String sandboxPath = PictureFileUtils.createFilePath(ctx, "", mineType, customFileName); if (PictureMimeType.isContent(url)) { inputStream = PictureContentResolver.getContentResolverOpenInputStream(ctx, Uri.parse(url)); } else { inputStream = new FileInputStream(url); } boolean copyFileSuccess = PictureFileUtils.writeFileFromIS(inputStream, new FileOutputStream(sandboxPath)); if (copyFileSuccess) { return sandboxPath; } } catch (Exception e) { e.printStackTrace(); } return null; }


15929721851 avatar Jun 01 '22 00:06 15929721851