View Single Post
Old 09-22-2011, 05:04 AM   #3
CdnBloodlust
Member
CdnBloodlust doesn't litterCdnBloodlust doesn't litter
 
Posts: 18
Karma: 120
Join Date: Sep 2011
Location: Edmonton, AB
Device: Kobo Touch
What's cuter tux or gnu? Maybe should've made it tux.

Code for how the custom animation was created. Thanks to the people who documented the process of setting up telnet etc and kobo devs for not locking down the device.

Code:
# files not included that need to be generated or whatever

/home/foo/animation/gnu.png
/home/foo/extra.raw

# create png from the svg template

rsvg <(printf "$(cat on-template.svg)" a a a a a) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" b a a a a) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" c b a a a) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" c c b a a) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" c c c b a) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" c c c c b) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" c c c c c) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" a c c c c) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" a a c c c) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" a a a c c) custom/on-$((i++)).png
rsvg <(printf "$(cat on-template.svg)" a a a a c) custom/on-$((i++)).png

# convert the generated png to raw gziped images

cd custom
for input in on-*.png; do
output=${input%.*}.raw
ffmpeg -i "$input" \
-vf transpose=2 -f rawvideo -pix_fmt rgb565 -s 600x800 -y "$output" < /dev/null
cat "$output" /home/foo/extra.raw | gzip -c > "$output.gz"
done

# create gif animation
convert on-{0..10}.png -delay 25 test-25.gif

# file on-template.svg
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="800">
	<defs>
		<rect id="a" x="4.5" y="4.5" fill="none" stroke="black" stroke-width="1" width="17" height="17"/>
		<rect id="b" width="26" height="26"/>
		<rect id="c" x="4" y="4" fill="black" width="18" height="18"/>
	</defs>
	<rect fill="white" width="600" height="800"/>
	<image x="177" y="177" width="246" height="240" xlink:href="/home/foo/animation/gnu.png"/>
	<g transform="translate(211, 468)">
		<use xlink:href="#%s" transform="translate(0)"/>
		<use xlink:href="#%s" transform="translate(38)"/>
		<use xlink:href="#%s" transform="translate(76)"/>
		<use xlink:href="#%s" transform="translate(114)"/>
		<use xlink:href="#%s" transform="translate(152)"/>
	</g>
</svg>
I've been looking for a way to emulate the server so when you press the sync button on the kobo touch it'll go to my custom perl server script and download ebooks from my computer rather than kobo. I don't know if I'll release the code on that since I don't want kobo to lock down the device.

Anyways I'm having mixed results so far lots of trial and error.
CdnBloodlust is offline   Reply With Quote