Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image load failed when upload file to cloud #3675

Closed
jwbecalm opened this issue Jul 9, 2020 · 20 comments
Closed

image load failed when upload file to cloud #3675

jwbecalm opened this issue Jul 9, 2020 · 20 comments

Comments

@jwbecalm
Copy link

jwbecalm commented Jul 9, 2020

typora version: 版本0.9.9.33.2 (4442)

image upload to GitHub is successful but after upload, the image can not preview in the editor, and it hints "image load failed"

@jwbecalm
Copy link
Author

jwbecalm commented Jul 9, 2020

And I try to "when I insert a picture, copy the picture to a ./${filename}.assets, and use the relative path,
when I paste the picture and choose to upload all local pictures, after upload successfully, the picture in the editor is gone.

@jwbecalm
Copy link
Author

jwbecalm commented Jul 9, 2020

I can find the picture in the directory ./${filename}.assets

@abnerlee
Copy link
Contributor

abnerlee commented Jul 9, 2020

Can you download the image from the url after upload using wget or other tools?

@jwbecalm
Copy link
Author

jwbecalm commented Jul 9, 2020

I can find the file in the GitHub repo:
https://github.com/jwbecalm/pic_for_write/tree/master/img

but when I copy the whole link to a web browser, it hints 404: Not Found
https://raw.githubusercontent.com/jwbecalm/pic_for_write_master/img/image-20200709184442618.png
the above link is generated by PicoGo automatically.

is it my setting for PicoGo wrong?
in PicoGo setting--GitHub setting--set the customer domain: https://raw.githubusercontent.com/jwbecalm/pic_for_write_master

@jwbecalm jwbecalm closed this as completed Jul 9, 2020
@jwbecalm
Copy link
Author

jwbecalm commented Jul 9, 2020

sorry click close, please continue to help me

@jwbecalm
Copy link
Author

it seems OK now, I try to delete all text in typora, and try again, it works now.
a picture can upload to the cloud successful and can show in Typora normal,
and also when I copy the whole link to the web, it can see the image:
https://raw.githubusercontent.com/jwbecalm/pic_for_write/master/img/image-20200710075905193.png

I know the issue, I configure wrong for the domain, it should be:
https://raw.githubusercontent.com/jwbecalm/pic_for_write/master

@jwbecalm
Copy link
Author

now, it closed..thank u for bother you

@jwbecalm jwbecalm reopened this Jul 10, 2020
@jwbecalm
Copy link
Author

now the img can show in the GitHub:
https://raw.githubusercontent.com/jwbecalm/pic_for_write/master/img/image-20200710162554586.png

but in the typora, after uploading to GitHub, there's no picture showing in the editor
image

and I go to the relative dir in my computer, the img is there in the ./${filename}.assets

@abnerlee
Copy link
Contributor

I can see the image using ![](https://raw.githubusercontent.com/jwbecalm/pic_for_write/master/img/image-20200710162554586.png) in my test.

Did you wait sometime for Typora to load it?

Did you check if you have proxy set, or Typora is able to load the image without any network issues.

@jwbecalm
Copy link
Author

jwbecalm commented Jul 11, 2020

I mean when the img is in local, it's oK for typora as follows
image

but after I click format ---image-- upload all image, typora hints upload successfully, but int the typora edtor, the image is gone as follows:
image

at this time, I also can see the image in github:
https://raw.githubusercontent.com/jwbecalm/pic_for_write/master/img/image-20200711082907928.png

I am wondering, maybe it is about proxy, I have used proxy for chrome, so the image can upload successfully, but in the typora, typora do not know the proxy setting, so after the image upload to github, it can not fetch the image.
but the upload in typora is successful, so, I thingk proxy is working well for typoa,

@mightyjoe781
Copy link

I m facing the same problem as well files uploaded as assets render properly on local, but same files when uploaded on github show errors.

@mightyjoe781
Copy link

Ok got it error was that Typora can load relative path names even though they have spaces or not but this doesn't work on github

@abnerlee
Copy link
Contributor

Ok got it error was that Typora can load relative path names even though they have spaces or not but this doesn't work on github

I see, it is #1520

@jwbecalm
Copy link
Author

please tell me how to solve it? I can see the image from github url, what you mean spaces?
I have no spaces in my local path

@mightyjoe781
Copy link

By spaces i meant the folder with name "Abner Lee" -This is not detected by GIthub Repo but Typora Detects it
Advice- Use underscore format
specify path with forward slash " /" (See URL Above) rather than using windows default backward slash ""

@jwbecalm
Copy link
Author

it's confusing, my relative dir have no space, and I also specify path with /,
for example, typora hint "image load failed". you can see below url have no spaces, no /
image-20200723135634361

@mightyjoe781
Copy link

Can u please provide more information with little more details. Like what u trying to do.
In the meantime check this small repo out it helped me a lot.
https://github.com/mightyjoe781/relative-image-url.

@abnerlee
Copy link
Contributor

abnerlee commented Aug 6, 2020

I can load "image-20200723135634361" in my test, can you access the image without any proxy?

@mightyjoe781
Copy link

Yes image is visible without any proxy in my case!

@abnerlee
Copy link
Contributor

Please try open "Sources" tabs in DevTools (which you can open from "Inspect Element" in context menu after you enable debug mode in help menu), and see if the image is loaded success or not, and see if its url is correct or not.

Or, you can open "Network" tags in DevTools first, then input images in Typora, and see the error in console or network tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants