cfss-old / fa18_hw01

Repository for homework 01
0 stars 45 forks source link

Images not showing up correctly on Github #13

Open Bobicheng-Zhang opened 6 years ago

Bobicheng-Zhang commented 6 years ago

I am having trouble displaying an image on Github even though it shows up on RStudio preview perfectly. The error message I received after clicking on the picture is 404. Is anyone else having this problem?

ghost commented 6 years ago

I'm having the same problem!

bensoltoff commented 6 years ago

In order to troubleshoot, you need to either push your commit to your hw01 fork or copy and paste the code here.

mayank-kgp commented 6 years ago

@Bobicheng-Zhang @avajurden Most likely it is because of the image URL. If the image exists in your laptop and not in Github then you need to push the image to GitHub. Also, reply with the markdown which you have written in Readme file.

Bobicheng-Zhang commented 6 years ago

I have pushed the commit to branch homework1 in my hw01 fork.

![](/Users/zbbc/Github/Hw1/IMG_0929.jpg)

This is what I used. Since I pushed the image to Github, I also tried using the file path on Github, but that didn't work either.

mayank-kgp commented 6 years ago

@Bobicheng-Zhang Your image url is /Users/zbbc/Github/Computing_SS/Hw1/IMG_0929.jpg This path exists on your laptop but not on the server(i.e. GitHub). That's why the image is not being shown.

bensoltoff commented 6 years ago

Instead stage and commit the image inside of your hw01 repo. Then the file path is just the name of the image

Bobicheng-Zhang commented 6 years ago

@mayank-kgp I also copied the file path Github gave me but it didn't work either.

mayank-kgp commented 6 years ago

@Bobicheng-Zhang Make the url - IMG_0929.jpg or /IMG_0929.jpg. Let me know if either of these url works.

Bobicheng-Zhang commented 6 years ago

It worked! Thank you! @bensoltoff @mayank-kgp

mayank-kgp commented 6 years ago

@Bobicheng-Zhang You don't need to do branching as there are separate repositories for each homework which you need to fork every week. However, it doesn't matter.

abbygirlrose commented 6 years ago

Any idea why my image would show up in my own git (https://github.com/abbygirlrose/hw01) but not inside the pull request (https://github.com/uc-cfss/hw01/pull/14/commits/aff1b98a0afe09a8f382b1cf7cc7fa81fe9b4134?short_path=04c6e90#diff-04c6e90faac2675aa89e2176d2eec7d8)?

mayank-kgp commented 6 years ago

@abbygirlrose Because the image file exist on your own git. But it is not on the uc-cfss Github repo yet. You have sent the image as a part of the pull request. So once your pull request is merged then it will be shown. Meanwhile, you can try editing the image url as https://github.com/abbygirlrose/hw01/blob/master/ab.png (url of image in your own git) and see if it works.

abbygirlrose commented 6 years ago

hm thanks!