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

can not preview local pics in 0.11.13 #2834

Closed
zzxxhhzxh opened this issue Jan 26, 2019 · 16 comments · Fixed by #2835
Closed

can not preview local pics in 0.11.13 #2834

zzxxhhzxh opened this issue Jan 26, 2019 · 16 comments · Fixed by #2835
Labels
bug 🐛 Issue concerns a bug.

Comments

@zzxxhhzxh
Copy link

zzxxhhzxh commented Jan 26, 2019

Current behavior

Can not show the pics(jpg,bmp,gif,svg) by markdown which is OK in previous version. But images by website is OK.

new bitmap image

![Google_2015_logo.svg](:storage\65473ce7-2769-4949-ad80-e348f9f261c6\e78c79d4.svg)
Does not show image.

![](https://upload.wikimedia.org/wikipedia/commons/2/2f/Google_2015_logo.svg)
Does show image.

Expected behavior

Can show local images.

Steps to reproduce

Drag local pics to notes.

Environment

  • Version : 0.11.13
  • OS Version and name : Win10 64bit professional
@XarisA
Copy link

XarisA commented Jan 26, 2019

I am experiencing the same issue. I added a comment here #1988 (comment) .

@Skovisen
Copy link

Skovisen commented Jan 26, 2019

A quick temporary fix for this is to change the last non-trailing slash ( \ ) to a trailing slash ( / ). This worked for me on Windows.

So in the case of
![Google_2015_logo.svg](:storage\65473ce7-2769-4949-ad80-e348f9f261c6\e78c79d4.svg)
change it to
![Google_2015_logo.svg](:storage\65473ce7-2769-4949-ad80-e348f9f261c6/e78c79d4.svg)

When this issue is resolved, remember to modify this back to it's original state, or it might cause issues in loading the images properly.

@XarisA
Copy link

XarisA commented Jan 26, 2019

A quick fix for this is to change the last non-trailing slash ( \ ) to a trailing slash ( / ). This worked for me on Windows.

So in the case of
![Google_2015_logo.svg](:storage\65473ce7-2769-4949-ad80-e348f9f261c6\e78c79d4.svg)
change it to
![Google_2015_logo.svg](:storage\65473ce7-2769-4949-ad80-e348f9f261c6/e78c79d4.svg)

That seem to work but it is possible to result in error after the issue is resolved. So maybe we should just wait.

@Skovisen
Copy link

A quick fix for this is to change the last non-trailing slash ( \ ) to a trailing slash ( / ). This worked for me on Windows.
So in the case of
![Google_2015_logo.svg](:storage\65473ce7-2769-4949-ad80-e348f9f261c6\e78c79d4.svg)
change it to
![Google_2015_logo.svg](:storage\65473ce7-2769-4949-ad80-e348f9f261c6/e78c79d4.svg)

That seem to work but it is possible to result in error after the issue is resolved. So maybe we should just wait.

Yea, that's why I said it's a quick fix. I guess a better word is temporary, I'll edit my original comment.

ehhc added a commit to ehhc/Boostnote that referenced this issue Jan 26, 2019
…d that issue in the future + test modified so that they both contain tests for posix and windows path separator -> fixes BoostIO#2834
@ehhc
Copy link
Contributor

ehhc commented Jan 26, 2019

@daiyam @Rokt33r can you have a look at this? I've reverted the change breaking the attachemnts because i still don't understand what they do.. Furthermore i tried to let the tests test both linux and windows path separator

@daiyam
Copy link
Contributor

daiyam commented Jan 26, 2019

@ehhc the function fixLocalURLS works on the HTML code so the \ should be generated as %5C. Is it the case?
I don't have a working windows so I was unable to test it. I did assume the tests were correct (mdurl.encode(path.win32.sep)).

@ehhc
Copy link
Contributor

ehhc commented Jan 26, 2019

The problem is the regex only matched the first '' not the following ones (separating the noteKey).. Nonetheless: i don't understand why the expression has to be that complicated instead of the simple form present before (and after my PR)... I completed the tests so that they test with a noteKey as well.

@daiyam
Copy link
Contributor

daiyam commented Jan 26, 2019

@ehhc what is the generated html?
The simpler regex assumes that an image path was terminated by an " which is no longer the case due to the added gallery block.

@daiyam
Copy link
Contributor

daiyam commented Jan 26, 2019

@ehhc I found the error in the regex, pretty stupid 😭
And thanks you for the updated tests (they are failing correctly with the bad regex)

@ZeroX-DG ZeroX-DG added the bug 🐛 Issue concerns a bug. label Jan 27, 2019
@Rokt33r
Copy link
Member

Rokt33r commented Jan 28, 2019

We're trying to fix this now. After it fixed, I will release new version as soon as possible.

@zzxxhhzxh
Copy link
Author

I found the new problem, if I drag "Google_2015_logo.svg" to note, it will show like below

![Google_2015_logo.svg](:storage\6547f261c6\e78c79d4.svg)

But if I try to locate and open the file "e78c79d4.svg", I will find it is a png format image. So I have to change the extension and change the markdown sentense with "new splash" to

![Google_2015_logo.svg](:storage\6547261c6/e78c79d4.png)

Now it will work. This only happens in svg format. Png, jpg work well.

@ehhc
Copy link
Contributor

ehhc commented Jan 29, 2019

@zzxxhhzxh i think that's another idependent problem.. Could you open a new issue for it?

@daiyam
Copy link
Contributor

daiyam commented Jan 29, 2019

@zzxxhhzxh if you look at your jpg, you will see that in reality, it's an png. When pasting or dropping an image, Boostnote tries to fix its rotation (PR #2322), to do that, it converts the image as png... Ideally, there should be an option to disable this behaviour.
You should open a new issue if you would like it to be fixed.

@zzxxhhzxh
Copy link
Author

zzxxhhzxh commented Jan 29, 2019 via email

@Rokt33r
Copy link
Member

Rokt33r commented Feb 8, 2019

It has been fixed v0.11.15. But, sadly, you have to install it manually because the auto updater in v0.11.13 is broken too... Please download it from https://github.com/BoostIO/boost-releases/releases/tag/v0.11.15.

@llfung
Copy link

llfung commented Feb 22, 2019

The image now displays properly once updated from v0.11.13 to v0.11.15. However, since the update changes the "" to"/", the photo is now not properly rendered in the exported html file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Issue concerns a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants