Sign in to follow this  
Followers 0
null54

Base64 FileType (2016-04-02)

33 posts in this topic

This plugin loads and saves Base64 encoded images.
 
Only BMP and PNG format images can be saved.
The format of the text file is UTF8.
 

On 8/12/2015 at 7:45 AM, midora said:

The file extension is .b64
A b64 file contains a png or a bmp image encoded as base64 text.
Open a .b64: The filetype plugin decodes the text of the file back to the contained png or bmp image and then opens this image in paint.net.
Save as .b64: The filetype plugin takes the open image, converts it to png or bmp (there is an option in the dialog), converts the result to base64 text and then saves the text.

 

btn_donate_SM.gif

Download:


Base64FileType.zip

 

Source Code:

 

https://github.com/0xC0000054/pdn-base64

2

Share this post


Link to post
Share on other sites

Great.

Can you add a few setting to prepend the code with the correct base64 syntax "data:image/png;base64,".

And maybe an option to build the HTML tag for an image or CSS for background image...

0

Share this post


Link to post
Share on other sites

Great.

Can you add a few setting to prepend the code with the correct base64 syntax "data:image/png;base64,".

And maybe an option to build the HTML tag for an image or CSS for background image...

 

Added a Data URI format check box, HTML and CSS formats can be selected from a list.

File version updated to 1.0.0.1.

0

Share this post


Link to post
Share on other sites

What's about a raw option (just the BGRA data)?

 

Do you mean encoding the raw pixel data without saving as BMP or PNG first?

0

Share this post


Link to post
Share on other sites

Sorry I totally missed your response.

 

Sometimes I need a  raw base64 BGR or RGB stream. But I can always use a tool to convert it.

 

Two non-important issues:

 

1)  If you are using file format BMP and set the HTML or CSS option then the loader part is not always able to load the file (you can also see this in the save dialog that the file size always tells "computing...". )

 

2) If you are setting URI data type to HTML and then switch off DATA URI encoding then the Insert line break checkbox stays disabled. You first have to set URI data type to None. Seems to be a small issues with the IndirectUI rules.

0

Share this post


Link to post
Share on other sites

Both of those issues have been fixed, file version updated to 1.0.0.3.

0

Share this post


Link to post
Share on other sites

Thanks. But now in both cases (html and css) the plugin is not able to load and does not stop computing.

 

>>The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

 

There is an other thing you may think about. It's about the extension. I would prefer that the plugin uses .b64 instead of .txt.

In my case .txt conflicts with a plugin which loads .txt files as bitmaps. So I always have to decide what to install.

0

Share this post


Link to post
Share on other sites

Thanks. But now in both cases (html and css) the plugin is not able to load and does not stop computing.

 

>>The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

 

There is an other thing you may think about. It's about the extension. I would prefer that the plugin uses .b64 instead of .txt.

In my case .txt conflicts with a plugin which loads .txt files as bitmaps. So I always have to decide what to install.

 

I cannot reproduce that error.

 

As for the extension it would be en easy change.

0

Share this post


Link to post
Share on other sites

Maybe it depends on the file. So here is a file which is always showing computing (in 3.5.11 and 4.0) if HTML or CSS is selected.

FLAG_B24.zip

 

I verified that in both cases 1.0.0.3 is in the FileTypes folder.

I would prefer the change of the extension. Especially because it is not a standard user file content.

Edited by midora
0

Share this post


Link to post
Share on other sites

That issue is fixed, and the file extension has been changed.

File version updated to 1.0.0.4.

0

Share this post


Link to post
Share on other sites

Hi,

 

can you add compression support?

 

What type of compression?

0

Share this post


Link to post
Share on other sites

Hello,

 

I am sorry, but how can I use this plug in to open an image from base64 string. I have added the dll to the plugins folder, but don't know how to use it.

0

Share this post


Link to post
Share on other sites

This is a filetype plugin. It should be placed in the \Filetypes\ folder. You access the new file types via the list of extensions in the load/save dialogs.

0

Share this post


Link to post
Share on other sites

Thank you for your answer. Such folder did not exist, so I created it and placed the DLL inside: C:\Program Files (x86)\Notepad++\FileTypes, however, I don't see new option: http://screencast.com/t/OrU7lKK6rogC

 

Furthremore, should I save the base64 string in a file and open it with this extension. And if so, what the file extension should be?

0

Share this post


Link to post
Share on other sites

Hi checho,

I'm think the .dll goes into C:\Program Files\paint.net\FileTypes which should exist already.

I haven't used this particular file type but that's where file type plugin .dlls usually go.

0

Share this post


Link to post
Share on other sites

The description of the filetype is quite compact, I agree ;-)

 

The file extension is .b64

A b64 file contains a png or a bmp image encoded as base64 text.

Open a .b64: The filetype plugin decodes the text of the file back to the contained png or bmp image and then opens this image in paint.net.

Save as .b64: The filetype plugin takes the open image, converts it to png or bmp (there is an option in the dialog), converts the result to base64 text and then saves the text.

0

Share this post


Link to post
Share on other sites

The file extension is .b64

A b64 file contains a png or a bmp image encoded as base64 text.

Open a .b64: The filetype plugin decodes the text of the file back to the contained png or bmp image and then opens this image in paint.net.

Save as .b64: The filetype plugin takes the open image, converts it to png or bmp (there is an option in the dialog), converts the result to base64 text and then saves the text.

Excellent summary Midora! I've added this to the first post.

0

Share this post


Link to post
Share on other sites

I needed to save a file in b64 today (to embed it into a web page) and I thought I would have to download some spyware laden "freeware" program to do the conversion. Ugh. Then I thought... I bet someone has written a filetype plugin for paint.net!

null54, thanks for making this plugin. It worked like a charm!

0

Share this post


Link to post
Share on other sites

I needed to save a file in b64 today (to embed it into a web page) and I thought I would have to download some spyware laden "freeware" program to do the conversion.

 

Just for completeness: For that reason online converters exist like this one:

 

https://www.base64-image.de/

Edited by IRON67
0

Share this post


Link to post
Share on other sites

Hmmm... plugin may have a bug in it...

I'm trying to do about 20 of these little images and I notice that many times when I go to save one, it will never show me the preview. It sticks saying, "(computing)" and never finishes. If I press Save when it is in this state, it never saves the file and I have to kill paint.net with the task manager.

Can you look into it and possibly fix?

The files I'm trying to save are small, 16x16 icons with some transparency which is why I can't use BMP format (which always seems to work).

I've used it successfully to save larger images, so I'm not sure what the problem is.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0