Search code examples
github-pages

Github page make my .jpg image become a special image? (png image is normal)


Github page show image only .png work but no .jpg and .gif. So I don't think it is my path problem,because my .png image is show. Moreover,I get jpg become a special file but not 404 page.

For Example:

I can get png image by https://alwxkxk.github.io/blog/blog_images/empty-list.png enter image description here

But I get jpg image become a special image.

https://alwxkxk.github.io/blog/blog_images/005BIQVbgy1fuo1rwsry0j30t3097jtr.jpg

enter image description here

This picture in github is right: https://github.com/alwxkxk/blog/blob/gh-pages/blog_images/005BIQVbgy1fuo1rwsry0j30t3097jtr.jpg

enter image description here

How to debug this problem?

github page project url: https://github.com/alwxkxk/blog/tree/gh-pages

page :https://alwxkxk.github.io/blog/


Solution

  • INCORRECT ANSWER:

    Incorrectly generated url to your image. Try to use . before relative path ![](./blog/blog_images/005BIQVbgy1fuo1rwsry0j30t3097jtr.jpg).

    See answer for more details.

    EDIT:

    Reason why your jpg files are not shown is because they are Stored with Git LFS. See issue - according to it "GitHub Pages doesn't support Git LFS".

    There is workaround - do not use relative path, use absolute path with ?raw=true. Example: https://github.com/alwxkxk/blog/blob/gh-pages/blog_images/005BIQVbgy1fuo1rwsry0j30t3097jtr.jpg?raw=true