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't insert image link when "paste html or media" in some url #627

Closed
vanleo2001 opened this Issue Jul 13, 2017 · 22 comments

Comments

Projects
None yet
2 participants
@vanleo2001

vanleo2001 commented Jul 13, 2017

When I use shortcut ""ctrl-shift-v" to paset some media in note, I find it may be not work with some special url structure.
Url: http://images.forexpeacearmy.com/Weekly/EUR_USD_D1_12_07_10.jpg

log pane showed:
[18:01:08] [status] Downloading http://www.forexpeacearmy.com/community/attachments/eur_usd_4h_13_07_10-png.1716/
[18:01:08] [status] Done downloading images
[18:01:13] [status] Stored 1 note(s) to disk

But no media link was inserted into note, also no image was downloaded into media folder.

QOwnNotes ver 17.07.1
OS: win 7 x64

@pbek pbek added the question label Jul 13, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 13, 2017

I'm sorry, that's not how it works. The Shortcut is just for images, etc. that are actually in the clipboard, not just an url.

You could of course write a script if you want to achieve that. (Or you just use Ctrl + Shift + I to insert an image.)

I guess you might want to take a look at:

You can always ask if you have questions about scripting.

@pbek pbek closed this Jul 13, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 13, 2017

If you actually copy the image from your browser into your clipboard it also works.
I tried https://upload.wikimedia.org/wikipedia/commons/a/a5/Schlosspark-K%C3%B6ln-Stammheim-Kunst-und-Natur.JPG. For some unknown reason it doesn't work with your image.

@pbek

This comment has been minimized.

Owner

pbek commented Jul 13, 2017

Dragging your image from the browser to QOwnNotes did work for my example but not for your example. Storing the image from the browser locally and inserting it from there worked with both examples. Maybe it's some problem with the web-server your image is hosted on.

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 13, 2017

I copy the image into clipboard, But QOwnNotes doesn't work

I open the url http://www.forexpeacearmy.com/community/attachments/eur_usd_4h_13_07_10-png.1716/ with browser,such as IE or firefox, copy the image to clipboard. But it not work when pasting with ctrl-shift-v in QOwnNotes .
I do same with url http://images.forexpeacearmy.com/Weekly/EUR_USD_M_12_07_10.jpg, it works.

@pbek

This comment has been minimized.

Owner

pbek commented Jul 13, 2017

When you do that the image is not directly in the clipboard, it's just a html page that the browser generated. QOwnNotes attempts to parse that html page and generate some note text out of it. For some reason that doesn't work for your first example.

@pbek pbek removed the question label Jul 13, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 13, 2017

I found the culprit. When detecting the suffix of the downloaded file to use it as file-extension (which is 1716/ in your case) naturally the image can't be stored. I will add some precautions for such unpredictable urls like in your example.

@pbek pbek added this to the 17.07.2 milestone Jul 13, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 13, 2017

17.07.2

  • more problematic characters will be removed from the suffix of downloaded
    media files to make sure the file can be stored locally

@pbek pbek reopened this Jul 13, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 13, 2017

There now is a new release, could you please test it and report if it works for you?

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 13, 2017

I try the version 17.07.2. It can insert the image, but the file name is strange. Can you fix it?

the media link in note just like this :
![media-kj1604](file://media/23870.1717)

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 14, 2017

Today I find another error also about the media paste. As the opposite of above question, QOwnNotes may store a "blank" image into media folder.

Url 1 is http://marboo.io/i/build/Marboo-for-Web-%E4%BB%8B%E7%BB%8D.md.html.

You can see all images in this webpage are missing. If you open one image url 2, such as http://marboo.io/media/images/marboo/web-0.2/crx-install-0.png, you will get 404 page with THE image url. When you open the url 1 , copy the page content and "paste html or meida" , QOwnNotes will download 404 page as image file type and store it into media folder.

@pbek

This comment has been minimized.

Owner

pbek commented Jul 14, 2017

I will take a look at it.

@pbek pbek added the enhancement label Jul 15, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 15, 2017

17.07.3

  • files are now only downloaded if the status code of the request was "success"
    to prevent downloaded files with error pages
  • when downloading files a proper filename suffix will be set by detecting the
    mime type of the file

@pbek pbek modified the milestones: 17.07.2, 17.07.3 Jul 15, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 15, 2017

There now is a new release, could you please test it and report if it works for you?

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 16, 2017

Great! It works correctly. Thanks.

@pbek

This comment has been minimized.

Owner

pbek commented Jul 16, 2017

Great, thank you for testing!

@pbek pbek closed this Jul 16, 2017

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 18, 2017

In QON windows ver 17.07.3 , some webpage content with jpg files including can't be paste correctly with "ctrl-shift-v". In this version, some jpg files can't be insert into note and store into media folder, while ver 17.07.1 can do it correctly.
The annoying thing is some jpg can be insert correctly, some can not in ver 17.07.3. I don't know why? So I attach a jpg file for you to test it. if you open this jpg with browser, you can't drag it into QON note.

32293

@pbek

This comment has been minimized.

Owner

pbek commented Jul 18, 2017

Strange, I've no problem getting that image directly or as part as html...

@pbek

This comment has been minimized.

Owner

pbek commented Jul 18, 2017

It also worked under Windows for me. Does it work if you test it again from this GitHub page? Where did you originally copy the image from?

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 18, 2017

In addition, I use another pc with os win8.1 pro, All QON setting is default.

  1. I download the image to the desktop.
  2. I open the image on desktop with browser
  3. I drag this image in browser into QON note, it fail.
@pbek

This comment has been minimized.

Owner

pbek commented Jul 18, 2017

Did you try that with above image from GitHub?

@vanleo2001

This comment has been minimized.

vanleo2001 commented Jul 18, 2017

@pbek

This comment has been minimized.

Owner

pbek commented Jul 18, 2017

Dragging images from there (Chrome) into QOwnNotes worked for me under Windows. Although I haven't found the image you posted above.

@pbek pbek referenced this issue Aug 2, 2017

Closed

Never see Images #653

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