Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Image not displaying at a GitHub page?

When copying image name from properties windows 10 it won’t show up in GitHub pages.
code added:

<img src="https://ibb.co/gPvZ7JQ" width="300" height="300" alt="malak artwork">

I’ve converted the image into a URL still not working.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The link you have as src https://ibb.co/gPvZ7JQ is an HTML page.

You can verify that by performing a HEAD request.

I’m using curl in a bash shell

$ curl -I https://ibb.co/gPvZ7JQ
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 19 Dec 2021 05:15:29 GMT
Content-Type: text/html; charset=UTF-8 >>>>>>>>>> HERE
...

The content-type indicates what kind of response it is for the browser to be able to render.

If you visit the URL in the browser and inspect the webpage go to the Network tab and set the Img filter you can see this page requesting the image. Screenshot

In the headers for the image’s request you can see this

accept-ranges: bytes
access-control-allow-methods: GET, OPTIONS
access-control-allow-origin: *
cache-control: max-age=315360000
cache-control: public
content-length: 311784
content-type: image/png >>>>> so this is an image

The URL need not indicate whether this resource is an image or not.

For example

https://example.com/image.png          # May or may not be an image, could be a 404 and a html
https://example.com/image              # May be an image even when `.png` isn't there in the url
https://example.com/image.html         # Can also be an image if the site developer is nuts

So the solution for determining whether the URL is an image (or something else like video) is to pay attention to the Content-Type response header.

This is what every browser does and you should do too when in doubt.

And in your case, the URL will be https://i.ibb.co/Nm123Kf/my-oc-Uw-U-modified.png which can be found in the network tab or by inpect element on the image.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading