当前位置:网站首页>Root cause of glideexception: failed decodepath{directbytebuffer- > gifdrawable- > drawable}
Root cause of glideexception: failed decodepath{directbytebuffer- > gifdrawable- > drawable}
2022-06-30 00:03:00 【Dev sunny day】
Recently, I wrote a demo Use Glide When loading a picture, you suddenly find that the picture is not loaded , Major errors :
GlideException: Failed DecodePath{
DirectByteBuffer->GifDrawable->Drawable}
It's strange to check your code , Found the picture url There is a problem ,,,,,
Glide
.with(this)
.load("https://github.com/sunnnydaydev/DataBingding/blob/main/photo/glide_test.png")
.into(binding.img)
This picture is about yourself github A picture on the project , It may be due to Github#ReadMe Influence , I usually Github#ReadMe When you insert a picture in, you can directly insert the picture link in the project in rich text syntax to display the picture . Therefore use Glide I used this link directly when loading this image .
I've been talking for a long time about why I made a mistake In fact, pictures url There is a problem , This url It represents a page resource on the server , Not a specific picture resource .
Copy the above link to the browser and open it. You will find that the page is like this :

therefore Glide Get this url http After the request, you get the entire web page data . In order to load the picture correctly , Directly specify the correct picture path .
Then there is a problem , since Github#ReadMe The above... Is specified in url, Why can he load this picture correctly ???
I think the website is parsing ReadMe Rich text files are parsed to this url It will automatically go to the real server address of the picture . HMM, the process behind it should be like this .
Now I have another idea , Since the picture has a real server address , Can I find out ? In this way, I may be able to build a github Project placement picture , Then when the client needs to request online pictures, I can directly simulate here
It was found in the following way ,,,,Github#ReadMe page :

Found duplicate pictures url A query parameter is added after pasting it into the browser ?raw = true, then enter Then the magic appeared

The browser automatically goes to the server where the picture is located url, This url Regular :
https://raw.githubusercontent.com/ Yours Github user name /Github Picture in your project
After some exploration, I have gained a lot , However, there are still some things to pay attention to :
- github In the domestic instability, the opening timeout always occurs
- raw.githubusercontent.com The resources under this domain name seem to be inaccessible in China , Keep asking for rejection .
The above can be easily solved , Programmers? Just get a ladder
The end Exploration completed , yo-yo ,,,,
边栏推荐
- Common knowledge of ECS security settings
- 除子
- QPainter的使用入门:绘制象棋界面
- 大厂试水 HPE推出Arm CPU通用服务器产品
- Simple understanding of B tree and b+ tree
- Divisor
- 打造一个 API 快速开发平台,牛逼!
- Leetcode (76) -- Minimum Covering substring
- Yunhe enmo, gaiguoqiang, identify it and grasp it before the domestic database boils
- 由GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable}引起的刨根问底
猜你喜欢

Exploration and Practice on the future direction of byte cloud database

AI chief architect 9- huxiaoguang, propeller model library and industry application

代码分析平台 SonarQube 实战

Start harvesting! Nailing: adjust the maximum number of free users of "nailing team". If the number exceeds 10, it will not work normally

基于zfoo开发项目的一些规范
![Copy linked list with random pointer [space for time --hash record]](/img/d9/d81e0e4f81174c61275e4affe0777a.png)
Copy linked list with random pointer [space for time --hash record]

Teach you step by step to install webwind notes on edge browser

大厂试水 HPE推出Arm CPU通用服务器产品

MySQL:SQL概述及数据库系统介绍 | 黑马程序员

Binary search tree 230 The element with the smallest K in the binary search tree 1038 From binary search tree to larger sum tree
随机推荐
Zhongkang holdings opens the offering: it plans to raise HK $395million net, and it is expected to be listed on July 12
Buffer flow exercise
This simple little function saves 213 hours for our production research team in half a year
6.28日刷题题解
About mongodb error: connecting to: mongodb://127.0.0.1:27017/?compressors=disabled &gssapiServiceName=mongodb
Leetcode (76) -- Minimum Covering substring
Koa2 learning and using
QT learning 05 introduction to QT creator project
漫画安全HIDS、EDR、NDR、XDR
Bee common configuration
Solr基础操作14
What is flush software? Is it safe to open an account online?
333333333333333333333333333333
How to write controller layer code gracefully?
Jetpack之Room的使用,结合Flow
雲和恩墨蓋國强,識別它、抓住它,在國產數據庫沸騰以前
绿树公司官方网站
Create an API rapid development platform, awesome!
Sword finger offer 14- I. cut rope
[译]在软件开发行业工作 6 年后,那些年我曾改过的观念