09-22-2011, 02:03 AM | #1 |
Member
Posts: 18
Karma: 120
Join Date: Sep 2011
Location: Edmonton, AB
Device: Kobo Touch
|
Kobo Touch Telnet Images
Just wanted to share my notes with everyone on how the kobo touch displays images and the conversion process. I've also created a custom boot animation if anyone's interested.
Code:
############################################################################################################ # raw to png input=reboot.raw output=output.png ffmpeg -f rawvideo -pix_fmt rgb565 -s 800x600 -i <(head -c 960000 "$input") \ -vf transpose=1 -y "$output" < /dev/null ############################################################################################################ # png to raw # note the extra.raw is to create an image just like the ones found in /etc/images. It's unkonwn to me if the extra bytes are needed but I add them just incase. zcat ghostbuster.raw.gz | tail -c +960001 > extra.raw input=on-0.png output=testing.raw ffmpeg -i "$input" \ -vf transpose=2 -f rawvideo -pix_fmt rgb565 -s 600x800 -y "$output" < /dev/null cat extra.raw >> "$output" ############################################################################################################ # ssh and telnet printf "user root\nput testing.raw" | ftp -in 192.168.0.158 telnet 192.168.0.158 user root cat testing.raw | /usr/local/Kobo/pickel showpic ############################################################################################################ # extract all default images cd /home/foo/unsorted/kobo/kobocopy/etc/images for input in *.raw.gz; do ffmpeg -f rawvideo -pix_fmt rgb565 -s 800x600 -i <(zcat "$input" | head -c 960000) \ -vf transpose=1 -y "${input%%.*}.png" < /dev/null done ############################################################################################################ # get extra leading information cd /home/foo/unsorted/kobo/kobocopy/etc/images for input in *.raw.gz; do zcat "$input" | tail -c +960001 > "${input%%.*}-extra.bin" done for input in *extra.bin; do diff -s on-5-extra.bin "$input" done ############################################################################################################ # notes In the default images there's extra information at the end of each image, and it's exactly the same for each image. The extra bytes are 1.2 MB (1219072 bytes) of null bytes minus the 7 bytes listed below. Significance unknown, maybe a watermark? ... 00000FFC 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 40 21 00 00 00 00 00 00 00 00 00 00 40 21 00 00 40 21 00 00 00 00 00 00 00 00 00 .................@!..........@!..@!......... ... # what is this? /usr/local/Kobo/pickel disable.rtc.alarm ############################################################################################################ Edit: Added More Images. Last edited by CdnBloodlust; 09-22-2011 at 07:30 AM. |
09-22-2011, 04:01 AM | #2 |
Bibliophile
Posts: 167
Karma: 1147338
Join Date: Jun 2010
Location: New Zealand
Device: Sony PRS-T3, Kobo Touch
|
Why, that's a very nice GNU you have there. Would be a shame if something happened to it
|
Advert | |
|
09-22-2011, 05:04 AM | #3 |
Member
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> Anyways I'm having mixed results so far lots of trial and error. |
09-22-2011, 08:57 AM | #4 |
Porcupine Tree fan
Posts: 139
Karma: 357322
Join Date: Sep 2011
Location: Ottawa, Canada
Device: Kobo Touch
|
Very cool. Stay with Tux; nobody really knows what GNU is (hint: it's not Unix )
|
09-22-2011, 10:15 AM | #5 |
Member
Posts: 18
Karma: 120
Join Date: Sep 2011
Location: Edmonton, AB
Device: Kobo Touch
|
Thank you.
So much stuff I could post but I don't wanna spam this forums. Look how the kobo touch communicates with the kobo servers for ebooks. Here's one example which isn't filled out (I've seen what the filled out request looks like too). Code:
<?xml version="1.0" encoding="UTF-8"?> <KEpubRequest xmlns="http://kobobooks.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://kobobooks.com Requests.xsd"> <RequestHeader> <UserID>%1</UserID> <UserKey>%2</UserKey> </RequestHeader> <RequestBody> <ContentType>6</ContentType> <ContentID>%3</ContentID> <EPubPlatform>%4</EPubPlatform> <NeedUserInfo>%5</NeedUserInfo> <NeedDownloadURLs>%6</NeedDownloadURLs> </RequestBody> </KEpubRequest> |
Advert | |
|
09-22-2011, 10:38 AM | #6 |
Porcupine Tree fan
Posts: 139
Karma: 357322
Join Date: Sep 2011
Location: Ottawa, Canada
Device: Kobo Touch
|
Those look like passed parameters to me, or global variables.
|
09-22-2011, 12:21 PM | #7 |
Connoisseur
Posts: 95
Karma: 3198
Join Date: Jul 2011
Location: Canada
Device: Kobo Touch
|
They probably made them numbered so that they'd be (hopefully) unique in the document, for (to them) easier search and replace. Maybe a full blown XML parser and manipulator would be too much for the small device.
|
09-23-2011, 12:55 AM | #8 |
Member
Posts: 18
Karma: 120
Join Date: Sep 2011
Location: Edmonton, AB
Device: Kobo Touch
|
So have you guys been working on anything interesting for the touch? Or finding anything interesting?
Also something interesting you can see that when you convert the the default images from raw to png there's no pure white color in the image. Maybe it has a custom color palate or something? Don't know much about color palates tho, it never interested me. What you guys think? Should custom images also use that color palate or does it not really matter. Edit: To answer my question about the %1 %2 thing it's part of the qt framework thing. Code:
#include <QString> #include <QtDebug> int main() { qDebug() << QString("%1 test %2").arg("1", "2"); qDebug() << QString("%1 test %2").arg("3").arg("4"); return 0; } Code:
% ./test "1 test 2" "3 test 4" % Last edited by CdnBloodlust; 09-23-2011 at 06:16 AM. |
08-10-2012, 05:31 AM | #9 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jun 2012
Device: Kobo Touch
|
sorry mistake !
Last edited by kalabala; 08-10-2012 at 06:13 AM. |
Tags |
images, kobo, telnet, touch |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rooted Nook Touch vs Kobo Touch? | producerism | Which one should I buy? | 20 | 09-09-2011 10:10 PM |
Kobo Touch vs Nook Simple Touch | jbcohen | Which one should I buy? | 42 | 07-28-2011 06:38 PM |
Kindle 3, Nook Simple Touch, Kobo Touch and Libra Pro Touch | jbcohen | Which one should I buy? | 4 | 06-18-2011 07:58 PM |
Own (and love) a PRS505: Is the Nook Touch or Kobo Touch right for me? | rahulm | Which one should I buy? | 8 | 06-10-2011 01:51 PM |
Pre-ordering Nook Simple Touch or Kobo Touch? | SilentDuck | Which one should I buy? | 27 | 05-29-2011 05:27 PM |