Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Make pasting an image in CodeEditor work#818

Merged
asmsuechan merged 2 commits into
BoostIO:masterfrom
asmsuechan:work-paste-image
Aug 23, 2017
Merged

Make pasting an image in CodeEditor work#818
asmsuechan merged 2 commits into
BoostIO:masterfrom
asmsuechan:work-paste-image

Conversation

@asmsuechan

@asmsuechan asmsuechan commented Aug 19, 2017

Copy link
Copy Markdown
Contributor

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

asmsuechan commented Aug 22, 2017

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@asmsuechan asmsuechan Aug 22, 2017

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

jlsjonas commented Sep 26, 2017

Copy link
Copy Markdown

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

xanderberkein commented Oct 9, 2017

Copy link
Copy Markdown

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

@garulovilla

garulovilla commented Oct 18, 2017

Copy link
Copy Markdown

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants