当前位置:网站首页>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 ,,,,
边栏推荐
- QT learning 01 GUI program principle analysis
- Leetcode (680) -- verifying palindrome string II
- Set up security groups, record domain names, and apply for SSL certificates
- 500 error occurred after importing skins folder into solo blog skin
- HTAP x cloud native: tidb accelerates the release of data value and realizes data agility
- Analysis of common vlog parameters
- golang7_ TCP programming
- JS绘制极坐标颜色渐变
- The role of VMware virtual machine
- Sword finger offer 14- I. cut rope
猜你喜欢

How to view the CPU cores and threads in win11? Win11 view the tutorial of how many cores and threads the CPU is

云和恩墨盖国强,识别它、抓住它,在国产数据库沸腾以前

QT learning 06 widgets and window types

After crossing, she said that the multiverse really exists

HPE launched ARM CPU general server product

Set up security groups, record domain names, and apply for SSL certificates
![克隆無向圖[bfs訪問每條邊而不止節點]](/img/34/2a1b737b6095293f868ec6aec0ceeb.png)
克隆無向圖[bfs訪問每條邊而不止節點]

FPGA Development (2) -- IIC communication

【一起上水硕系列】Day 8

爬虫入门实战:斗鱼弹幕数据抓取,附送11节入门笔记
随机推荐
绿树公司官方网站
HTAP x cloud native: tidb accelerates the release of data value and realizes data agility
After working in the software development industry for six years, I changed my ideas in those years
ThinkPad VMware installation virtual machine: this host supports Intel VT-x, but Intel VT-x is disabled (problem resolution)
Cloner un Graphe non recté [bfs accède à chaque bord et pas seulement aux noeuds]
label问题排查:打不开标注好的图像
How to view the CPU cores and threads in win11? Win11 view the tutorial of how many cores and threads the CPU is
@Scheduled注解的坑,我替你踩了
[leetcode] a number that appears only once [136]
Halcon practical: design idea of solder joint detection
modelsim的TCL脚本的define incdir命令解析
Set up enterprise NTP time server
雲和恩墨蓋國强,識別它、抓住它,在國產數據庫沸騰以前
Embedded development: Hardware in the loop testing
Solr基础操作14
I wonder if I can open an account today? In addition, is it safe to open an account online now?
Sword finger offer 14- ii Cutting rope II
Which securities company should I choose to open an account online? Also, is it safe to open an account online?
Machine learning: the concept and application of VC dimension
Shell operator