【问题标题】:Unable to load a remote Image captured using Phone Camera using Firebase Storage无法使用 Firebase 存储加载使用手机摄像头拍摄的远程图像
【发布时间】:2021-03-27 23:02:33
【问题描述】:

使用 手机摄像头 可以使用 photoIntent 捕获图像,然后上传捕获的图像成功,我可以观察 Firebase 存储中捕获的​​图像 但我无法从 Firebase 存储 加载图片,我只能查看占位符,但 从图库中发布的图片 已加载到图片视图并且 可见photoIntent 和我使用 Picasso 库Firebase 存储 呈现这些图像可能是什么问题?任何帮助,将不胜感激 附加的方法从 Firebase 实时数据库 接收图像 url,并且应该在图像视图中加载图像

` private void assignDetails(String d_name, String d_phone, String d_image, String d_email, String d_location, String d_price, String d_capacity) {
    tv_name.setText(d_name);
    tv_phone.setText(d_phone);
    tv_email.setText(d_email);
    tv_location.setText(d_location);
    tv_price.setText(d_price);
    tv_capacity.setText(d_capacity);

    Picasso.with(getApplicationContext).load(d_image)
            .placeholder(R.drawable.back_image)
            .fit()
            .centerCrop()
            .into(detail_image);
}`

【问题讨论】:

  • 请分享您的代码,以便其他人查看。使用代码 sn -p 没有人可以提供帮助。

标签: android firebase-storage picasso


【解决方案1】:
  • 恭喜终于渲染正常了,问题不在于 Firebase 存储,而在于 Picasso 库。
  • 解决方案:将毕加索图书馆更新到最新版本:
  • 注意: 旧版毕加索 (picasso:2.5.2) 存在一个错误,该错误会阻止加载大图像(即 10MB),尤其是对于较新的照相手机具有更大的分辨率。如果您遇到此问题,您可能需要在撰写此回复时升级到最新的毕加索版本(picasso:2.71828)。查看最新版本https://github.com/square/picasso

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-06
    • 1970-01-01
    相关资源
    最近更新 更多