egoist / toolcat-releases

Releases for Toolcat
https://toolcat.app
4 stars 0 forks source link

Feature Request: Base64Encode should allow binary data #12

Closed hschneider closed 6 months ago

hschneider commented 6 months ago

I mostly use base64encode to encode images and other assets, which is the main purpose of this kind of encoding. Would be nice to have a file open dialog or better drag and drop, to encode such files.

egoist commented 6 months ago

you can drag and drop text files into the editor, does it work for you? if not are you using Windows?

egoist commented 6 months ago

oh I see you are encoding images, it's not supported yet, but I'm releasing Image to Base64 soon, do you want support for other files?

hschneider commented 6 months ago

Thanks! IMHO it makes sense to all binary files. Base64Encoding is my favorite encoding when transporting binary data of any kind with e.g. JSON over the network.

egoist commented 6 months ago

what is your use case for that? such as transferring a mp4 file in base64 over the network

hschneider commented 6 months ago

I have currently 2 use cases:

  1. Encode image resources to strings and embed them in source code, to avoid loading external file assets. Currently I prepare these files via commandline.
  2. Using custom JSON based API protocols to save binary data of any kind in a database. Here I encode these files via code on the fly, but having it in ToolCat would be helpful to generate test data.

So the most needed use case would be image encoding: jpg, gif, png and svg. Other users might prefer other file types ...

egoist commented 6 months ago

Image to Base64 is available now in https://github.com/egoist/toolcat-releases/releases/tag/v0.2.19

hschneider commented 6 months ago

Great! Thanks!