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

Make pasting an image in CodeEditor work #818

Merged
merged 2 commits into from
Aug 23, 2017
Merged

Make pasting an image in CodeEditor work #818

merged 2 commits into from
Aug 23, 2017

Conversation

asmsuechan
Copy link
Contributor

@asmsuechan asmsuechan commented Aug 19, 2017

context

I made pasting an image work.

before

Nothing happens when I paste an image.

after

I can paste an image from clipboard.
9d989912ab0c470243b2bbfefe78ef2f

For tests

  • does not work when I paste .pdf or something that are not images.
  • Paste .png on macOS
  • Paste .jpg on macOS
  • Paste .png on windows
  • Paste .jpg on windows
  • Paste .jpg on Linux
  • Paste .png on Linux

@asmsuechan
Copy link
Contributor Author

asmsuechan commented Aug 22, 2017

This feature works even if the image is jpg or something that are not png.
I confirm it only on macOS Sierra 10.12

I used impbcopy to insert images into clipboard http://www.alecjacobson.com/weblog/?p=3816


reader.readAsDataURL(blob)
reader.onloadend = () => {
base64data = reader.result.replace(/^data:image\/png;base64,/, '')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@asmsuechan asmsuechan Aug 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the reason why the image is copied as png even if it's jpg. So this line works fine even if it's jpg.
EDITED: I guess it's because of the program I used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the jpg file I pasted from the clipboard.
image

@asmsuechan asmsuechan merged commit 1b16c68 into BoostIO:master Aug 23, 2017
@asmsuechan asmsuechan deleted the work-paste-image branch August 23, 2017 04:05
@kazup01 kazup01 mentioned this pull request Sep 23, 2017
@jlsjonas
Copy link

jlsjonas commented Sep 26, 2017

This feature seems to be broken...

It does seem to (try?) storing the images; but the resulting path doesn't actually render them
image

image

(v0.8.15)

edit: from what I see it never saves the image

@xanderberkein
Copy link

xanderberkein commented Oct 9, 2017

Can confirm, got the same problem.
I'm on Boostnote 0.8.15, macOS 10.13

@garulovilla
Copy link

garulovilla commented Oct 18, 2017

I think it's important to check if the images are in use and remove those that are no longer necessary. By the way great feature. 👍

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

Successfully merging this pull request may close these issues.

None yet

6 participants