Adding Gif Annimation files in bulk Directly from Internet

Adding Gif Annimation files in bulk Directly from Internet

Postby taeril » Sat Aug 10, 2019 4:45 pm

Hello there,

way back when i started to learn Chinese with FCD, was having lot of issues with finding a way to efficiently and fast add gif animations for each character to mine deck in FCD, which would help me learning to write characters in right stroke order, as i found, with FCD space repetitions I could learn to write characters in few repetitions, of course with repeating it over time.

So tonight i come up with solution how to do it after reading here on forum that gif once loaded from web page will get download into FCD media folder so after once app loads gif, you dont need internet connection for it, once it has been shown once, and once you have html code for characters, you can set deck on auto play and the app will automatically go through all your cards so you dont need to do that yourself either.

As a source for gifs i chose MBDG site:
https://www.mdbg.net/chinese/rsc/img/stroke_anim/28450.gif

Notice the 28450 number in web address, thats Unicode name of characters, so basically, you just change this number in the address and it will download that character, and generating this web addres of each character is easy to do in any spreadsheets.

So you need to get Unicode for each character,
=unidode(A1),
and you do that by splinting characters, each into their own cell, i did this by this two functions:
=REGEXREPLACE("" & A2, "(.)", "$1,") (adds periods in between characters)
=split (C2, ",") (splits characters at separator, in this case period)

After that
=IF(ISBLANK(D2), "",unicode(D2))
paste this formula in cell n times away from target fist character (i added it to 11th cell, as i had up to 9 characters in words in mine vocabulary list) and then just pull cell function to further 11 cells example in 11th cell: =IF(ISBLANK(M2), "",unicode(M2))

So now you have unicode for each character, now add:
<img src="
https://www.mdbg.net/chinese/rsc/img/stroke_anim/
.gif
" width=105>

each into their own cell and add function to join them all together with a unicode numbers, mine formula looks like this:
=IF(ISNUMBER(O2),$Z$1&$AA$1&O2&$AB$1&$AC$1,"")
and you will get:
<img src="https://www.mdbg.net/chinese/rsc/img/stroke_anim/38515.gif" width=105>
and pull this function to another 10 cells so you cover all characters.

Then join all the html code for each word by function that joins values in two or more columns
=Z2&AA2&AB2&AC2&AD2&AE2&AF2&AG2&AH2&AI2
and you get:
<img src='https://www.mdbg.net/chinese/rsc/img/stroke_anim/38515.gif' width=105><img src='https://www.mdbg.net/chinese/rsc/img/stroke_anim/26376.gif' width=105><img src='https://www.mdbg.net/chinese/rsc/img/stroke_anim/32654.gif' width=105>

Edited: changed ' with ", both will work, but ' around web address will download GIFs in temporary file while " will download them into media folder of the app.

Spreadsheet with functions looks like this:
gif.png
spreadsheet with process of producing html code for each character
gif.png (114.31 KiB) Viewed 3810 times


Ive spent less than 2 hours in coming up with functions, and did this for over 1200 words, but now when i need this again, its just mater of copy pasting, as i have now functions ready.

Also, once you have all the gifs downloaded (works only on android) you can go to media folder of that deck, copy all gif files and update them to internet platform, or program that can change speed of animation, if you feel animations are to slow or to fast, and then just return them to media folder once you have their speed set to your liking.

Hope you find this useful.
Attachments
gif2.png
gif html code in deck
gif2.png (167.13 KiB) Viewed 3810 times
Last edited by taeril on Wed Sep 25, 2019 6:30 am, edited 1 time in total.
taeril
 
Posts: 35
Joined: Fri Mar 29, 2019 8:34 pm

Re: Adding Gif Annimation files in bulk Directly from Intern

Postby Ernie » Mon Aug 12, 2019 8:03 am

Hi taeril,

Great info! Thanks for sharing
Ernie
Site Admin
 
Posts: 5009
Joined: Fri Oct 01, 2010 6:12 pm
Location: San Francisco / Taiwan

Return to Comments, Questions and Feedback