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

Automatically encode images with base64 #491

Closed
korteke opened this issue Jan 23, 2017 · 11 comments
Closed

Automatically encode images with base64 #491

korteke opened this issue Jan 23, 2017 · 11 comments
Labels
Type: Feature adds functionality
Milestone

Comments

@korteke
Copy link

korteke commented Jan 23, 2017

Hi,
(Feature request)

Is it possible to add base64 encoding to images when exporting to HTML.

Use case: Usually I make notes with QOwnNotes, but sometimes I have to export them to the Atlassian Confluence. In Confluence I use HTML macro so notes without images works just fine, but when there is images on the notes I have to manually upload those to the Conflu.

So one more export option "Export note as HTML with encoding" or something like that.

@pbek pbek added the Type: Feature adds functionality label Jan 23, 2017
@pbek
Copy link
Owner

pbek commented Jan 23, 2017

Exporting them base64 encoded makes sense, thank you for your suggestion.
Can Confluence handle div containers with base64 encoded images as CSS-style?

@pbek
Copy link
Owner

pbek commented Jan 23, 2017

Or are we talking about real img tags, like

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAADSCAMAAABThmYtAAAAXVB">

@pbek
Copy link
Owner

pbek commented Jan 23, 2017

I even consider making this the new export, without a new menu entry...

@korteke
Copy link
Author

korteke commented Jan 23, 2017

It seems that it can handle both.

<style>
div.imgtest {
        background:  url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7)
    	no-repeat
    	left center;
  	padding: 0px  5px 20px;
}
</style>

</head><body>
<div class="imgtest">
Test test
</div>
</body></html>

and

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAADSCAMAAABThmYtAAAAXVB">

@pbek
Copy link
Owner

pbek commented Jan 23, 2017

thank you

@pbek
Copy link
Owner

pbek commented Jan 24, 2017

17.01.9

  • when exporting a note as html the images are now base64 encoded and included
    inside the html

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

@pbek pbek added this to the 17.01.9 milestone Jan 24, 2017
@korteke
Copy link
Author

korteke commented Jan 24, 2017

That was quick :) I will test it after the Travis has compiled version for Mac OS X.

@pbek
Copy link
Owner

pbek commented Jan 24, 2017

Travis for OS X is slow today... ;)

@pbek
Copy link
Owner

pbek commented Jan 28, 2017

Did it work?

@pbek pbek closed this as completed Jan 28, 2017
@korteke
Copy link
Author

korteke commented Jan 31, 2017

I think that I already commented on this, but apparently not. But yes, it worked :)

There is issues with Confluence if the picture is very large, because I tested one image which had almost 300k character on one string when it was decoded to base64. Conflu was Little bit sluggish :)

@pbek
Copy link
Owner

pbek commented Jan 31, 2017

Thank you for testing!

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

No branches or pull requests

2 participants