Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-11-2016, 03:39 PM   #1
pipcat
Connoisseur
pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 200153
Join Date: Apr 2016
Device: Kobo Glo Hd
Patch PNG images in Kobo firmware

I don't have any need to change Kobo images, but poking around I made some simple python scripts to search, extract and patch them. This is really not very useful, but if someone is interested, it's not difficult to do.

For example, you can change the image shown on "About Kobo" with your prefered logo or a customized photo.
It's easy to do because there is only one image (790 x 330 px) for each device model and it's easy to locate.

But depending of wich images you want to change, there could be many variations for diferent devices/resolutions, and you should try-and-hope to know wich ones are used on your device. There are 1.239 images in nickel 3.19.5761, about 2,6 mb.

Readme.txt:
Spoiler:
Code:
Tool to extract and patch png images inside Kobo binaries
=========================================================

- python search.py
	- Edit variable KOBO_FW_FOLDER to fill your path to Kobo firmware files.
	- Execute to find streams in Kobo firmware files.
	- With firmware 3.19.5761 we get this:
	0 zlib streams, 58 png streams. libchess.so
	0 zlib streams, 8 png streams. libcrossword.so
	0 zlib streams, 7 png streams. librushhour.so
	52 zlib streams, 0 png streams. libsolitaire.so
	{'.css': 0, '.mng': 0, '.png': 0, '.txt': 52, '.qm': 0}
	2 zlib streams, 20 png streams. libsudoku.so
	{'.css': 0, '.mng': 0, '.png': 2, '.txt': 0, '.qm': 0}
	43 zlib streams, 1239 png streams. nickel
	{'.css': 25, '.mng': 1, '.png': 4, '.txt': 2, '.qm': 11}

- python extract-png.py
	- Edit variable KOBO_FW_FOLDER to fill your path to Kobo firmware files.
	- Execute to extract png images.

- If you want to modify images, some tips:
	- Edit the png images you want to modify with your preferred software.
	- Don't remove image number and hexadecimal position from images filename (it's needed to find them in binaries when patching!)
	- New png images could not be larger than original ones!
	- Normally you can't change a simple image with a high-resolution photo for example because you are limited by filesize.
	- But you can make some changes if you careful and optimize image.
	- After your changes, use a compressor to reduce image filesize. Ex: compresspng.com optimizepng.com tinypng.com etc...

- nickel images:
	- There are 1.239 png embedded in nickel 3.19.5761
	- Some images are repeated with diferent resolutions for diferent devices.
	- You probably must try-and-hope to locate wich images you need to change for your device.
	- I only changed an image shown on my "About Kobo Glo Hd" (nickel-0375-175c6a.png) with a custom logo, 
	because it was very easy to locate (1 ocurrence with Model N437)

- python patch-png.py
	- Edit variable KOBO_FW_FOLDER to fill your path to Kobo firmware files.
	- Edit variables NEW_IMAGES and calls to patch_pngstreams with your selection.
	- If you already patched nickel, you may want to indicate it in call to patch_pngstreams.
	- Execute to patch png images.

- Execute ./publish.sh to create KoboRoot.tgz, and copy to folder .kobo/ in your device.
	- Edit lines starting with cp $DIR_BINARY/ to select wich files to patch.
Attached Files
File Type: zip patch-images-png-v01.zip (4.4 KB, 899 views)
pipcat is offline   Reply With Quote
Old 06-11-2016, 09:09 PM   #2
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
I also had a mod that does this:

https://www.mobileread.com/forums/sho...d.php?t=262837

It's fun but I think your CSS idea is more interesting, though.

( We need a Kobo Mods database too, not just hacks/patches... something like https://ankiweb.net/shared/addons/ )
frostschutz is offline   Reply With Quote
Advert
Old 06-12-2016, 04:02 AM   #3
pipcat
Connoisseur
pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 200153
Join Date: Apr 2016
Device: Kobo Glo Hd
Thx frostschutz, your post with nickelicons was nice and with good tips, I didn't saw it. The main difference is that your script run on device and mine on pc. I agree with you, it's fun but not so useful ;-D

A Kobo Mods database (KMD) could be nice ;-)
- With patches we can load all data from Metazoa packs, but this can't be done with Mods and will require "human loading".
- Patches also have a defined structure, that allows to manage them, but I'm not sure how to proceed with Mods.
- Any ideas, suggestions of what to include in KMD ? ...
pipcat is offline   Reply With Quote
Old 06-12-2016, 09:32 AM   #4
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,544
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by frostschutz View Post
( We need a Kobo Mods database too, not just hacks/patches... something like https://ankiweb.net/shared/addons/ )
Quote:
Originally Posted by pipcat View Post
A Kobo Mods database (KMD) could be nice ;-)
And perhaps the wiki would be a better place to host it (within MR) than a forum thread. At least that could be a start.
Jellby is offline   Reply With Quote
Old 06-12-2016, 10:40 AM   #5
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
Quote:
Originally Posted by pipcat View Post
The main difference is that your script run on device and mine on pc.
Yes, I like to run things directly on the device whenever possible. Did it for collections (AutoShelf) and firmware patches too (AutoPatch mod, but discontinued due to lack of popularity ), maybe with your database it would be possible to (de)select patches directly on the reader itself without help from PC. But the way patches currently work, you're supposed to edit them (sometimes it's three patches in one, with two variants commented out) and editing probably won't work too well if you have to do it directly on the reader...

On the other hand it's a huge time investment to develop such things (to a decent level) and at some point you just prefer to spend that time ing...

Haven't actually developed anything for Kobo in a while
frostschutz is offline   Reply With Quote
Advert
Old 06-12-2016, 12:57 PM   #6
surquizu
Evangelist
surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.
 
surquizu's Avatar
 
Posts: 411
Karma: 902071
Join Date: Jun 2008
Location: Zaragoza (Spain)
Device: prs-505, kobo auraHD, kobo auraH2O, kobo Glo HD, kobo aura ONE
Quote:
Originally Posted by frostschutz View Post
.

Haven't actually developed anything for Kobo in a while
I use the autoself and I still waiting The Remote Page Turning Controller for make my button and install it on the reader.
surquizu is offline   Reply With Quote
Old 06-12-2016, 01:07 PM   #7
pipcat
Connoisseur
pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 200153
Join Date: Apr 2016
Device: Kobo Glo Hd
Quote:
Originally Posted by frostschutz View Post
Yes, I like to run things directly on the device whenever possible. Did it for collections (AutoShelf) and firmware patches too (AutoPatch mod, but discontinued due to lack of popularity ), maybe with your database it would be possible to (de)select patches directly on the reader itself without help from PC. But the way patches currently work, you're supposed to edit them (sometimes it's three patches in one, with two variants commented out) and editing probably won't work too well if you have to do it directly on the reader...

On the other hand it's a huge time investment to develop such things (to a decent level) and at some point you just prefer to spend that time ing...
I like how you nicely run things on the device, very interesting. That gives a better understanding of Kobo internals. But I also like to run things outside the device because I feel more comfortable.

If you want current KHD database returns a new format for your needs to patch directly on the reader, I can add. Normally, I prefer to write code than to read, no problem ;-)

I had troubles connecting to my home hidden wi-fi, so I disabled it because all my ebooks are side-loaded and don't need it. And I never tried Kobo browser, I don't know if KHD website with bootstrap/jquery is rendered ok and if login, editing and downloading is possible.

If a Mod were only a collection of patches, it could be already done with KHD website. A user profile is like that, a collection of (de)select patches that can also be edited. Editing patch code from Kobo is probably not too much comfortable, but you can have your profiles updated once from pc and only select them from device.
pipcat is offline   Reply With Quote
Old 06-12-2016, 02:52 PM   #8
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Quote:
Originally Posted by frostschutz View Post
Yes, I like to run things directly on the device whenever possible. Did it for collections (AutoShelf) and firmware patches too (AutoPatch mod, but discontinued due to lack of popularity ).
Haven't actually developed anything for Kobo in a while
I really like both!!!
AutoShelf is the only method for me to use nickel . I dislike the standard collections.
And allways update my patch collections for AutoPatch.
boriar is offline   Reply With Quote
Old 06-12-2016, 03:57 PM   #9
surquizu
Evangelist
surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.
 
surquizu's Avatar
 
Posts: 411
Karma: 902071
Join Date: Jun 2008
Location: Zaragoza (Spain)
Device: prs-505, kobo auraHD, kobo auraH2O, kobo Glo HD, kobo aura ONE
Quote:
Originally Posted by pipcat View Post
I don't have any need to change Kobo images, but poking around I made some simple python scripts to search, extract and patch them. This is really not very useful, but if someone is interested, it's not difficult to do.

For example, you can change the image shown on "About Kobo" with your prefered logo or a customized photo.
It's easy to do because there is only one image (790 x 330 px) for each device model and it's easy to locate.

But depending of wich images you want to change, there could be many variations for diferent devices/resolutions, and you should try-and-hope to know wich ones are used on your device. There are 1.239 images in nickel 3.19.5761, about 2,6 mb.

Readme.txt:
Spoiler:
Code:
Tool to extract and patch png images inside Kobo binaries
=========================================================

- python search.py
	- Edit variable KOBO_FW_FOLDER to fill your path to Kobo firmware files.
	- Execute to find streams in Kobo firmware files.
	- With firmware 3.19.5761 we get this:
	0 zlib streams, 58 png streams. libchess.so
	0 zlib streams, 8 png streams. libcrossword.so
	0 zlib streams, 7 png streams. librushhour.so
	52 zlib streams, 0 png streams. libsolitaire.so
	{'.css': 0, '.mng': 0, '.png': 0, '.txt': 52, '.qm': 0}
	2 zlib streams, 20 png streams. libsudoku.so
	{'.css': 0, '.mng': 0, '.png': 2, '.txt': 0, '.qm': 0}
	43 zlib streams, 1239 png streams. nickel
	{'.css': 25, '.mng': 1, '.png': 4, '.txt': 2, '.qm': 11}

- python extract-png.py
	- Edit variable KOBO_FW_FOLDER to fill your path to Kobo firmware files.
	- Execute to extract png images.

- If you want to modify images, some tips:
	- Edit the png images you want to modify with your preferred software.
	- Don't remove image number and hexadecimal position from images filename (it's needed to find them in binaries when patching!)
	- New png images could not be larger than original ones!
	- Normally you can't change a simple image with a high-resolution photo for example because you are limited by filesize.
	- But you can make some changes if you careful and optimize image.
	- After your changes, use a compressor to reduce image filesize. Ex: compresspng.com optimizepng.com tinypng.com etc...

- nickel images:
	- There are 1.239 png embedded in nickel 3.19.5761
	- Some images are repeated with diferent resolutions for diferent devices.
	- You probably must try-and-hope to locate wich images you need to change for your device.
	- I only changed an image shown on my "About Kobo Glo Hd" (nickel-0375-175c6a.png) with a custom logo, 
	because it was very easy to locate (1 ocurrence with Model N437)

- python patch-png.py
	- Edit variable KOBO_FW_FOLDER to fill your path to Kobo firmware files.
	- Edit variables NEW_IMAGES and calls to patch_pngstreams with your selection.
	- If you already patched nickel, you may want to indicate it in call to patch_pngstreams.
	- Execute to patch png images.

- Execute ./publish.sh to create KoboRoot.tgz, and copy to folder .kobo/ in your device.
	- Edit lines starting with cp $DIR_BINARY/ to select wich files to patch.
It works well , but for use with Windows is necessary to create the folder pngs
surquizu is offline   Reply With Quote
Old 06-13-2016, 03:31 AM   #10
pipcat
Connoisseur
pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 200153
Join Date: Apr 2016
Device: Kobo Glo Hd
Quote:
Originally Posted by surquizu View Post
It works well , but for use with Windows is necessary to create the folder pngs
Ok, thx. Yes, you need to create the folder where you want to extract (pngs/ by default) or change variable PNG_EXTRACT_FOLDER with your choice. I updated extract-png.py in https://github.com/pipcat/kobo/tree/...tch-images-png to include width and height in filenames, as tshering suggests on frostschutz post, because it's easier to find images for our device.
pipcat is offline   Reply With Quote
Old 06-14-2016, 03:09 PM   #11
pipcat
Connoisseur
pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.pipcat ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 200153
Join Date: Apr 2016
Device: Kobo Glo Hd
Quote:
Originally Posted by frostschutz View Post
Yes, I like to run things directly on the device whenever possible. Did it for collections (AutoShelf) and firmware patches too (AutoPatch mod, but discontinued due to lack of popularity ), maybe with your database it would be possible to (de)select patches directly on the reader itself without help from PC. But the way patches currently work, you're supposed to edit them (sometimes it's three patches in one, with two variants commented out) and editing probably won't work too well if you have to do it directly on the reader...

Haven't actually developed anything for Kobo in a while
frostschutz, do you want to continue with AutoPatch, to process patches downloaded from website KHD ? That could be interesting, as you suggested ;-) More info: https://www.mobileread.com/forums/sho...8&postcount=11
pipcat is offline   Reply With Quote
Old 06-14-2016, 05:57 PM   #12
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
boriar's Avatar
 
Posts: 407
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
Please, say YES!
boriar is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PNG Images in ePUB Files not rendered on Kobo DragonflyKing ePub 12 10-12-2013 08:28 PM
DR1000 Patch for DR1000 firmware Mackx iRex Developer's Corner 273 06-18-2012 06:27 AM
Images in files/books and Firmware 1.8.2 on original Kobo Coop42 Kobo Reader 11 12-28-2010 07:48 AM
jetBook Firmware v0.33g patch 13 sein Ectaco jetBook 10 12-19-2009 06:40 PM
where to get autorun.xml, icon.png, key.png, lut.bin for PRS-505 obender Sony Reader Dev Corner 2 01-25-2009 03:20 PM


All times are GMT -4. The time now is 01:23 AM.


MobileRead.com is a privately owned, operated and funded community.