I am working on a script to basically insert a gif as metadata into a fx preset file. If you open Adobe bridge and browse to the After effects text presets you will see that you can click on a preset and in the preview there is an animated GIF. So I am attempting to do this for custom presets.
Basically I think I need to read the contents of a GIF file as data, or text, then encode that as base64 and insert it into the metadata of the preset file.
The problem is when I read in the GIF as data I can't seem to get all the data.
The code I'm using is
Code: Select all
file = new File("C:\\test.gif");
file.open("r");
test = file.read();
alert(test);
Code: Select all
GIF89aØ
Code: Select all
GIF89aØ  ô ÿÿÿ–••øøøòòòìììæææà à à ÛÛÛÕÕÕÃÃÃÊÊÊÅÅÅ¿¿¿¸¸¸°°°¨¨¨ŸŸŸŒŒŒƒƒƒ{{{rrriii___VVVMMMCCC999///###!ÿNETSCAPE2.0 !ù ÿ , Ø  ÿ Ždižhª®lë¾p,Ãtmßx®ï|ïÿÀ pH,ÂȤrÉl:ŸÃ¨tJÂZ¯Ø¬vËÃz¿à °xL.›Ãè´zÃn»ßð¸|N¯Ûïø¼~Ãïûÿ€Â‚ƒ„…†‡ˆ‰Š‹ŒÂŽÂ‘’“â€â€¢â€“—˜™š›œÂžŸ ¡¢£¤¥¦§¨©ª«¬Â®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÃÂÃÄÅÆÇÈÉÊËÌÃÃŽÃÃÑÒÓÔÕÖרÙÚÛÜÃÞßà áâãäåæçèéêëìÃîïðñòóôõö÷øùúûüýþÿ
HÂ°Â ÃÆ’*\Ȱ¡Ã‡#JÅ“H±¢Å‹3jÜȱ£Ç CÅ I²¤ÉE! !ù ÿ ,! C Và ÂdYJ›Tlë¶HF½4Å“eÂ¥KM+è:@,JZݢRé9²†Ë¥gÆJF—Î ôJl¶¶\@|õVÃÆ/`Ö®ÅjtÛŠ¯§ñp›|¥è\{ovK! !ù ÿ ,0 I ˆ TÅ’`Å¡[3Y‹w—ôÛ,à Å&9q¯jñBÅ“2ˆEìzÂWK‹Šk BxÂ0ÀÆkâ„¢ ]¬L’kâx¿[ù$.0n&-;
‚&L;E‰ ;AŽ;dŽ yÂŽ5/
ËœCMt'^%‰6_ËœL›˜fœ˜! !ù ÿ ,@ H  Ž¢·qd dM ’7zÂ,…ì‹MI0›-¿†ÃCô l KOv0ÂP‘Åñ\e™Ô&(X›!‰Óp¾é '{£Õ#¶ÃÛ,„I2|>.$R2g?#H`Å’?‚X“‘?(“‰ƒYpjY7wr)§®$°±CÆ’x±p´%«´! !ù ÿ ,C H ë ŠÞÆÂh
p¦ZP@Öt!y*à QØ'Q@ èùh‹M*³8ú’BcaÂ86p¢Mó'¸4Œ“O€µ’ ©]z€FFY|Ç(GAè4)3?"wP84am#k4'ÂN›I’â€#Ëœ ¡›Gž)–>—DÂ±Â±ÂÆ’(Z4"º·9s0vFu>ÃÀ>} U‚$†6*X¦Ã€#gÅ
MbØGá)äGP’f>Xªéb“"òÀ$-P¤òG0ÇÀ‚…äK˜ð C‚?>=ô×o"° !ù ÿ ,a I ªà UŒ`R × d*"qE@®U‚KÙ…`akpN[ á9AlÓ/€¢Êª)eë8@‹ J/lð´óJl ©!\ÉÛñà .6 |scPDO,DV[5"%6‡6.&|yG]u7 ˜K
KM««-Â’5h?#MÂÅ J€„J
§(SeG&޲Ç/;.yË&! !ù ÿ ,y H
= Ž€·™MQÅ“RPÛâfÂ[Àu ¹.ÅÉ<%ãáä
Òæè!m$À3°ˆNÖ\Õ™Ã*»Y×vt
¼£ !ù ÿ ,„ B 0 x¢(ÃdH,×¾âÖHd©ïÜR
€ÌŠ3$QËœd.ÂÊ£S
ÂF¯V@ !ù ÿ ,ˆ E bà Œd&q$à ¥R[*KÃˤPÃi£¶µ`¡ ðø<º âZ®¢ 1¦’<’/çÊŽ¶#ìÃ{ÃÂ`€¸wÞÓk-kwa“(Qˆ}tA(h2
JÂi?JU8$+ ! !ù ÿ ,– H k ŽÞÆÂèH!A'ʱn½‘K[@T葤…ÈŒ2¬‚à I.Q"À’42â„¢â€bC©y]EÉï[+d†-ˆ`Ã^K<–Ÿ9•B¦é©†KDõ4c_7$+^0x%& ! !ùF ÿ ,£ H S ޤÇq$…PE •MX‚-{žèA¶šN Ëœ~º@ArA-zHÛ“„Ø… €È¶- à ÂÄ(ø,öaÛ¾5ü«÷èáÂõZߢðl$! ;
So am I doing something wrong in reading in the gif? Do I need to specify some sort of encoding?