Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Changing the image to base64 code

Community Beginner ,
Oct 19, 2023 Oct 19, 2023

Hi, can someone tell me how to change image.jpg to base64 code in HTML5 canvas file? Animate generates JS with images in this form: {src:"img1.jpg", id:"img1"},{src:"img2.jpg", id:"img2"}, etc.
Is there any way I can change to base64 code?
This is an HTML5 animated banner.

TOPICS
ActionScript , Code , How to
483
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2023 Oct 19, 2023

Hi.

 

Do you want Animate to publish the assets as base64 code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2023 Dec 03, 2023

Hello this is exactly what i need. do you have any clue how to get the binary format of the image?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2023 Oct 19, 2023
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2023 Dec 03, 2023

Hello, how to include those scripts? I am really struggling when i am exporting svgs with an extension and all the images are included in a /img path. Then i manually have to edit the svg file and add the converted base 64 string (through https://www.base64-image.de/) for each image! There is a line in the javascript files of the extension 

var bitmapURI=this._getBitmapItem(item);

that will generate the name of the file but i need to access the source binary format. from where is this coming?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2023 Dec 03, 2023

@Asa246722338dy7 

 

use the include tab of the actions panel.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2023 Dec 03, 2023

thanks for your reply but i do not think it will work. i need to export through the extension Flash2SVG, there is a file SVG.jsfl at the extension that i am trying to edit the code with no luck. I found the line that it will print the images paths inside the .svg and i am trying to print the base64 instead of the path. Might be simple but i am lost. I also have a function iside that file that can convert a string to base 64 that is working correctly But if i tell the script to convert base64 it will convert the "img/my_image.png" to base64 (and not the main image to base64!) If you have some time to play and would like to help you can get the extension src here, the file i mention and looks that is the main exporter is inside. https://github.com/TomByrne/Flash2Svg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2023 Dec 03, 2023
LATEST

ok.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines