1. 程式人生 > >Glide從網路載入圖片報錯:class com.bumptech.glide.load.engine.GlideException: Failed to load resource

Glide從網路載入圖片報錯:class com.bumptech.glide.load.engine.GlideException: Failed to load resource

Glide: Load failed for “載入圖片的網址” with size [225x225]

 com.bumptech.glide.load.engine.GlideException: Failed to load resource
                                                     Cause (1 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, DATA_DISK_CACHE, http://40.125.207.182:8080/images/1523784096034.jpg
                                                            Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable}
                                                            Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->Drawable}
                                                            Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->BitmapDrawable->Drawable}


在網上查閱資料的過程中,發現了一個類似的解決方案,這裡附上網址:

Glide.with(context).(new URL(你要載入圖片的網址)).(image)

然而這並不能解決我的問題。

於是我決定先將圖片放到本地試試能不能直接載入:

檢視Log資訊後,我發現這一句:


再一看沒載入成功的圖片,畫素是6965*4648,密度過大導致無法載入,將圖片畫素調低後就可以了!


但回到網路載入,圖片依然沒有成功載入,這是怎麼回事呢?

將修改過畫素的圖片放到伺服器上(覆蓋原始檔)後,發現依然載入不成功,錯誤資訊依然是這個:


而我的圖片畫素已經修改為1567*1044,難道是伺服器出了問題?

於是把伺服器上原圖片刪掉再重新上傳,結果就可以了!可以了!

可以了!

敲打罵人疑問虧我折騰那麼久!看來還需要補一些伺服器web端的知識。

相關推薦

Glide網路載入圖片class com.bumptech.glide.load.engine.GlideException: Failed to load resource

Glide: Load failed for “載入圖片的網址” with size [225x225] com.bumptech.glide.load.engine.GlideException: Failed to load resource

maven項目使用tomcat啟動Server Tomcat v8.5 Server at localhost failed to start

com 再次 tar 同事 使用 sta 本地倉庫 art ati 背景說明:1)該項目為maven項目,使用的maven的本地倉庫裏有不少之前使用過下載的jar包;      2)從svn下載該項目後,無報錯情況;      3)部署到tomcat啟動報錯 如下 :

dmesgpci 0000:00:1c.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref]

1)00:1c.0, 00:1c.1, 00:1c.2, 00:1c.3 裝置如下,為PCI橋裝置 2)以第一個PCI橋00:1c.0為例,從shell介面可以看到BIOS給其分配的memory地址為90600000~908fffff,進入系統後,dmesg看到: 系統要給00:1c

org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [xxx]

org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [MultiTenantConnectionProviderImpl] at org.hiber

Eclipse(Java EE) Server Tomcat v7.0 Server at localhost failed to start.

在run Dynamic Web Project時,遇到了問題:tomcat啟動不了,並報錯:Server Tomcat v7.0 Server at localhost failed to start. 最後在Stack Overflow上找到了解決方法

tomcat服務啟動Server Tomcat v9.0 Server at localhost failed to start.

tomcat服務啟動報錯具體錯誤程式碼:四月 20, 2018 1:15:14 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/E

C# opencv 載入圖片

========================== 未經處理的異常:  System.TypeInitializationException: “Emgu.CV.CvInvoke”的型別初始值設定項引發異常。 ---> System.BadImageFormatExceptio

Intervention\Image Laravel php等比例壓縮圖片 Call to undefined method Intervention\Image\Image::make()

安裝 composer require intervention/image 開啟config/app.php,註冊如下服務提供者到$providers陣列: Intervention\Image\ImageServiceProvider::class 然

Android MediaPlayer 在API 28的手機上播放本地視訊正常,播放網路視訊,what=1, extra=-2147483648

在Android開發視訊播放器的過程中,發現一個怪異的Bug: 我是採用MediaPlayer+GLSurface實現的視訊播放器,並且作為依賴庫在Module中開發的。我利用下面的程式碼設定播放源: MediaPlayer mediaPlayer = new Media

Android Cordova 載入html deviceready has not fired after 5 seconds.

問題: 通過Cordova 載入html 頁面,在低版本手機上處理正常,但在高版本手機上出現異常(大概是Android 8.0 以上) 查明的原因大概是: 'deviceready has n

Linux中mysql進入命令行MYSQL ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.99.192' (111)

端口 connect 通過 l命令 linu serve nbsp linux err 場景:在Linux中安裝mysql01和mysql02,通過VIP虛出一個VIP=192.168.99.192,mysql01為主ip為192.168.99.153,mysql02為備機

Android studio執行單元測試 Class Not Found: Empty Test Suite

使用Espresso時報錯 Class not found: “com.test.LoginUnitTest”Empty test suite. 原因:沒有將該測試類新增到InstrumentedTest中 解決: 1.開啟配置,選擇Edit Configurations

SpringBoot JPA save的時候at com.sun.proxy.$Proxy154.save(Unknown Source)

2018-09-04 16:48:35.817 [http-nio-8070-exec-9] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - #23000 2018-09-04 16:48:35.873 [http-nio-807

Maven中日誌jar包衝突Class path contains multiple SLF4J bindings

錯誤表現: SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/D:/learn

python 安裝模組時提示Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat)

有時候,在Windows7x64下使用pip安裝包的時候提示報錯:Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat) 環境:windows8 x64 ,python2.7 ,VS2012 解決方案:Microsoft Vi

python 安裝模塊時提示Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat)

親測 解決 com pip安裝 crf 管理員 網上 pretty mic 有時候,在Windows7x64下使用pip安裝包的時候提示報錯:Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat

連線資料庫1130-Host 'xxx' is not allowed to connect to this MySQL server解決

出現這個問題的同學都很奇怪,為啥用localhost就可以連線上,但是使用本地ip就不行。出現這個問題的原因就是mysql未開啟mysql遠端訪問許可權導致。 這時候我們就用cmd去訪問下你的mysql下面的user表。具體操作如下: 1、連線伺服器: mysql -u root -p

MongoDB啟動缺失xxx.DLL檔案。exception: connect failed

其實在官方教程中有介紹,需要先打個補丁,補丁地址: downloading Update for Windows 7 for x64-based Systems (KB2999226) 如果不行,還有可能是MongDB是由C++編寫確實需要一些庫檔案,在Visual C+

MySQLERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

原因:mysql資料庫的user表裡,存在使用者名稱為空的賬戶可以視為匿名賬戶,導致登入的時候是雖然輸入的是root,但實際用匿名登入的; 解決辦法: 在my.cnf的[mysqld]欄位加入

docker執行容器Error response from daemon: OCI runtime create failed

今天在虛擬機器執行docker映象時,一直報錯(具體報錯原因待分析),檢查了系統核心和作業系統版本,也沒有找到結果。[[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.2.151