Jump to content

Kobo Cover Fixer


TheSaint
 Share

Recommended Posts

4 minutes ago, TheDcoder said:

Okay, so it's an imposter

The only imposter here is you, pretending you know what you are talking about. :muttley:

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

3 minutes ago, TheSaint said:

The only imposter here is you, pretending you know what you are talking about. :muttley:

I can go into more detail and give you some sources with verified information but I'll just let you be for now... I will let you live in your placebo world where you are right :muttley:

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Very sad, that you are now taking my topic off-topic with your delusions. :lol: 

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

@TheSaint Is that a challenge? I wasn't planning on doing another reply, but I can't find the :P emoji to react so take this post instead :P

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Gawd don't you ever stop? What challenge ... none was inferred by me. You were simply wrong about what placeholder and placebo mean ... end of story. Then you appeared to be referring to another topic we've been posting in. Please keep this topic on-topic, it isn't the Chat forum.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Oh well, not what I was expecting to do today, which was to test out my resulting code with my Kobo device.

But first I had this desire for some more helpful options to make some things easier etc. And then I spent much of the day doing them, and no device testing at all.

So I ended up making a few more changes and additions to the program and Results window.

1. I felt the need for a MARK button, to mark a row, which would persist after a reload or program close. Row gets colored YELLOW or OLIVE. (see screenshot above)

2. Then I needed a NEXT button to quickly jump to each marked row.

3. Then I thought it would be much easier to use UP and DOWN arrow buttons, rather than just scrolling and list entry clicking. Makes it easier to step through each entry looking for images that need fixing.

4. I also wanted a FIX button for renaming an author. This is purely where there is one author name, and it is surname first followed by comma and then first name(s). The row gets colored AQUA when this happens, unless the row is also marked, in which case the row gets colored OLIVE to indicate both states.

ISR_10.png?raw=true

To accommodate these new buttons, I decided to increase the height of the window to allow another row of controls. This also allowed me to have longer inputs for Title and Author, and to properly label a few things. Clipboard button was enlarged to suit. SUBS button was renamed to ADD. All round a great improvement I think.

During all this, I recalled I was supposed to have changed the positioning of the hidden CANCEL checkbox, that appears during the BACKUP IMAGES process. I'd changed the size of the BACKUP IMAGES button a couple of days ago. While checking that, I realized that due to that button now being multi-line, it would not look right when shrunk to half height to show the CANCEL checkbox. So not only did I need to fix the position of the CANCEL checkbox, I also needed to change the size of the text for both and not shrink the BACKUP IMAGES button as much. The SETTINGS button was also reduced in width to help things look better for the CANCEL checkbox, by widening the BACKUP IMAGES button a little.

So all that was the easy part, though it took a while.

Then because I now had a FIX button to rename the author name, I wanted a better method sorting, where title per sorted author was also sorted properly. This eventually meant creating a 2D array, after I tried a few other things first. I rarely work with 2D arrays, especially creating them from scratch, so it took a while (once again) to grasp what was required. I eventually got it right, including temporarily using an extra column that contained both Author and Title, then deleting that after sort had occurred, and the result is great. So loading the Ebooks List (which was also renamed) takes a few seconds longer now, but well worth it.

ISRinfo.png?raw=true

I've also made the sorting optional, as an option on the SETTINGS window.

KCF_setup_2.png?raw=true

I also thought I should add an Update Device SQLite option as well, though only the checking and unchecking is coded so far.

So that and a few family things today, meant I finished late and did no device testing. Tomorrow is a new day, and I feel better prepared now.

DOWNLOAD

Kobo Cover Fixer.au3  (57 downloads)  SEE THE FIRST POST in this topic for the latest version.
121.09 kB

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Yep, I am here early in the day (for me) for a change.

This was because I discovered a bug in my program, introduced recently when I modified the device (drive) checking function. I forgot to replace one instance of a variable. I did not have my external drive plugged in when I started the program today, and so the stored value for my working drive (with Kobo clone folders) was replaced by a non existent location, when I told it to find the drive after I plugged it in.

And I haven't tested the other stuff yet with my device, because I realized I hadn't yet grabbed all the source cover images and put them in that folder. The new MARK ability and NEXT button use allowed me to quickly sort that out, but during that process I discovered that some ISBN were much longer than normal. As the Title input is much longer than my longest ebook title listed, I was able to increase the length of the ISBN input until it was long enough to display all characters for the long instances.

ISR_11.png?raw=true

DOWNLOAD

Kobo Cover Fixer.au3  (58 downloads)  SEE THE FIRST POST in this topic for the latest version.
121.15 kB

And here's the icon I created back when I started the program, ready for the eventual compile.

Fixer.ico

I am hoping to do the testing today, though an adaption to another of my programs is chafing at the bit to get done, so I will work on at least some of that first, while the ideas are fresh.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Nothing to report at this point, as I got sidetracked ... by life and a couple of other programs updates ... and reading ... and a birthday.

Hopefully I will get to that testing later today or tomorrow. I only want to do it, when I can dedicate myself to it properly, without pressing time limits and distractions.

I need to do it soon though, as I have some new purchases to add to my Kobo device, and I don't really want to reload everything (database etc) again so soon.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

I am finally back working on this program again, as I did yet another update to one of those two other mentioned programs of mine yesterday.

No testing as yet, as I had some other thoughts, and decided to code most of that instead. I did this chiefly, because I am no longer sure I should be working with the current copy of 'KoboReader.sqlite' that I am using (working copy). The following screenshot probably best explains why.

Rep_query.png?raw=true   Dev_rep.png?raw=true

Those dialogs are part of my new additional code, added to the 'Program Settings' window, where I have changed the 'Other Options' section and added two new buttons to it - Copy Device SQLite and Replace Device SQLite. Both now fully coded, except for the Update Copied SQLite File checkbox, which has been moved and renamed, and while coded itself, does not yet impact anything ... as in no code yet done anywhere to write to the working copy of 'KoboReader.sqlite'.

KCF_setup_3.png?raw=true

 

At this point, I don't feel I have made many changes to the 'KoboReader.sqlite' file on my Kobo device, other than read a few ebooks, resulting in at least one 'Finished' and at least one page reading location change. So at the very least, I now need to be working with the updated copy of that file, instead of the one I have been using. That is as simple as copying that file from my Kobo device to my program folder, and overwriting the existing copy there. To that aim, I decided to code an even easier method to do that, hence the new Copy Device SQLite button.

Adding and coding both new buttons has been a preemptive strike, working on the presumption I will actually need to modify the 'KoboReader.sqlite' file at some point, perhaps sooner rather than later.

I still also need to check that my drive detection code does indeed discover my Kobo device drive ... depending on what type of drive it might be seen as. My code currently checks for Fixed and Removable drives, but maybe it will come up as Unknown or something. Because of the flaky nature of the USB connection of my Kobo device, I am refraining from plugging it in until I really need to.

We are almost there now.

DOWNLOAD

Kobo Cover Fixer.au3  (52 downloads)  SEE THE FIRST POST in this topic for the latest version.
131.88 kB

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

As a sidenote: remember that hot journal files may exist on a device running SQLite.  So an SQLite database may consist of a main DB file and (possibly) 1 or 2 journal files depending on journaling mode and termination mode of the application.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

You could well be right. There is also another file named 'BookReader.sqlite' which is passworded, that I cannot open.

In any case, after looking through the 'KoboReader.sqlite' file again, I cannot see anything other than Author name that might need fixing, where it is first name last and surname first. I guess there could be some cases where the ebook title might need correcting, but I don't recall seeing any ... or none that bother me anyway. I did also notice that a good number of the ebooks are missing an entry in the Description column, so I could do something about that. But Id rather not write to the 'KoboReader.sqlite' file unless I really have to, which doesn't seem to be the case. This does however appear to cancel the option of using my own number sub-folder names ... nowhere to enter them.


By the way, I was surprised to find that my slightly older version of the AutoIt Help file, does not have an Update example in the _SQLite_Exec command section. It seems weird to have an example to create a table and then add entries to it, columns and values, but no example of updating them. I seem to recall I came across this situation years ago, and so nothing has changed, unless it has since been added to a more recent AutoIt Help file. I tried to find the right command in my previous scripts working with SQLite, but could not find what I needed.

In the end I went online and did a search for SQLite Commands, and discovered or rediscovered the UPDATE  and SET keywords, as in the following.

_SQLite_Exec($handle, "Update tblTest set Author = 'Bill Smith' where Title = 'Book 1';)

If anyone is interested, I modified the example found in my AutoIt Help file for _SQLite_Exec.

#include <SQLite.au3>
#include <SQLite.dll.au3>

; WARNING - Needs sqlite3.dll to be present in script folder.

Local $hQuery, $aRow, $handle, $create, $database, $skip

$database = @ScriptDir & "\Test.sqlite"

_SQLite_Startup()
ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
$handle = _SQLite_Open($database)
; Without $sCallback it's a resultless statement
;MsgBox(262144, "Open Database Result", $handle)

$skip = ""
$create = 1
If $create = 1 And $handle > 0 Then
    ; CREATE TABLE & ADD ENTRIES
    _SQLite_Exec($handle, "Create table tblTest (a,b,c,Author,Title);" & _
        "Insert into tblTest values ('1','2','3','John Smith','Book 1');" & _
        "Insert into tblTest values ('4','5','6','John Smith','Book 2');")
ElseIf FileExists($database) And $handle > 0  And $create = 4 Then
    ; JUST ADD ENTRIES TO TABLE
    _SQLite_Exec($handle, "Insert into tblTest values ('7','8','9','John Smith','Book 3');" & _
        "Insert into tblTest values ('10','11','12','John Smith','Book 4');")
ElseIf FileExists($database) And $handle > 0  And $create = 5 Then
    ; UPDATE SOME ENTRIES IN TABLE
    _SQLite_Exec($handle, "Update tblTest set Author = 'Bill Smith' where Title = 'Book 1';" & _
        "Update tblTest set Author = 'Ben Smith' where Title = 'Book 3';")
Else
    $skip = 1
EndIf

If $skip = "" Then
    Local $d = _SQLite_Exec($handle, "Select rowid,* From tblTest", "_cb") ; _cb will be called for each row
EndIf

Exit

Func _cb($aRow)
    For $s In $aRow
        ConsoleWrite($s & @TAB)
    Next
    ConsoleWrite(@CRLF)
    ; Return $SQLITE_ABORT ; Would Abort the process and trigger an @error in _SQLite_Exec()
EndFunc   ;==>_cb

_SQLite_Close($handle)
_SQLite_Shutdown()

Just do your first run through with the variable $create = 1.

Then change it to $create = 4 for the second run.

And then $create = 5 for the last run.

You will see the results for each run in your console. I've also written to a local file, rather than memory which was the default in the original Help example.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Okay. I finally did the big test, and all okay so far. :D

I am however waiting for my Kobo to finish charging before fully investigating the results ... need to reboot my device.

And unbelievably I still haven't lost the USB connection to my PC. Will miracles never cease. :sweating:

I was able to add each single missing large image to a few ebooks.

I was also able to copy the many many placebo images to all the empty folders.

I also fixed all the images that were either black & white or wrong size or both. So hopefully we will now have good size color images, like it is for the rest (most) of the ebooks.

It all appeared to run without a hitch. And because I was in a hurry, just in case, that NEXT button was truly handy.

So shortly I will get to see if all my work (coding etc) paid off. Wish me luck. :) 

P.S. While I was at it, I added a few new ebooks sourced from elsewhere, not Kobo ... mostly from BookFunnel via authors or direct from the publisher. I might also need to fix the images for those.

EDIT

I don't know if it is just me, but it always seems to take ages for charging to get from 97% to 100%. I'm most of the way through reading an ebook on my Kobo too, so had to read that other ebook I have slowly been reading on my phone ... first novel I have ever read on my phone, for more than just a chapter or two or a few pages while out somewhere twiddling my thumbs. And LOL, I've just realized, that I had Samsung set for the reading device for that ebook, when it should have been phone ... Samsung is my 10" tablet, but also used to be my previous phone for many years.

My Kobo keeps on losing the connection now too and keeps wanting to reconnect, even though I have selected Cancel many times. Maybe the USB connection issue is related to how fully charged the battery is. Connect being connect to the computer as a drive. It's still connected for charging.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Well, less than pleasing results at this point, so I need to investigate further, as some covers weren't fixed, when they should have been.

I am suspicious that not everything copied as it should have.

I haven't seen any sign of the placebo files either ... yet ... which is not totally surprising.

And yes, the new ebooks that were imported need their covers fixed.

Of course, I ended up doing it all at the wrong part of the day ... time for bed now. When I awake I will check the device and probably my code.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

A new day and a somewhat new beginning.

My suspicion about the secondary copy option (Alternate Device Drive) proved to be true. I'd forgotten to set the overwrite flag.

With the primary copy option, working with the cloned device folders, there wasn't an issue. This was because my code deliberately deleted any existing image file that was being replaced by the FIX COVERS process. The replacement file was then created at that location with the GDIPlus code. Then, if use of the Alternate Device Drive was enabled, a copy of that created file was copied across to that second location, which in my case was to the Kobo device itself, in the correct images sub-folder. That clearly did not happen yesterday, because overwrite was not specified. So problem solved for that process now.

Then, because of the failure of the placebo images to reveal anything at this stage, I decided I should go all out and also try with the two other bigger image sizes, so I coded an option to allow doing that, plus a good amount of time testing to determine Font size and placement coordinates etc for these two new sizes. I also discovered an unnecessary bit of code in my original code with the smallest placebo image creation, which then made things simpler for the two bigger images. Note the 'Placebo Size' line in 'Other Options' in the following screenshot.

KCF_setup_4.png?raw=true

 

While doing the additional placebo code, I also decided to add a hide/show status label near the top of the Results window. That got rid of one Splash screen and gives more feedback during the BUILD and RELOCATE button processes for placebo images. The status text is shown in red, as seen in the following screenshot. Every ten created images that text gets updated during the build process, and every 50 copied images in the RELOCATE process. I also realized I hadn't added the code to disable all controls during the BUILD  process, so added that. And just now, laugh out loud, I realize I forgot to add it for the RELOCATE button process as well ... oh well ... all the placebo code might prove to be pointless anyway. :lol: 

ISR_12.png?raw=true

 

I haven't yet tested anything again with my Kobo device, that's next. I did however have the mid size placebo images be created in readiness for relocation, all 2960 of them.

By the way, my drive detection code did detect my Kobo device drive letter.

DOWNLOAD

Kobo Cover Fixer.au3  (47 downloads)  SEE THE FIRST POST in this topic for the latest version.
138.36 kB

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Damn flaky USB connection to my Kobo ereader device ... it played havoc for a while today, before finally settling down long enough to do the placebo images transfer.

I started with the FIX COVERS option, and besides having to repeat a few due to the USB issue, I eventually did them all followed by two separate sittings where I transferred the placebo images, rebooting my Kobo device in-between and after.

All the cover images that I fixed are now appearing on my Kobo device as they should. So that now definitely works.

I am yet to see any evidence of success for having added a few missing covers (where the known sub-folders exist) or when filling empty sub-folders with placebo images. All those empty folders have 120 image files in each now, with an image file for each of the three sizes within ... all 74 folders.

I added in the disable/enable controls code for the RELOCATE button process. I also tweaked the status label field, to accommodate a bit more text in the relocate process, which now also gets updated every two placebo folders copying. I had mistakenly called it files instead of folders. Also added another line in that process for the log file, plus a results dialog at the end.

In regard to the flaky USB connection, it seems to me the issue is software related, especially as it will lose the connection, then not much later find it again ... but of course you need to respond to a dialog when that happens or it won't continue with the connection. So alas with this issue, Wifi becomes even more important to me. I've now downloaded my recent purchases from Kobo to the device, which will require me starting over with the whole process of my program, if I need to use it again ... which I will for the several ebooks I side-loaded yesterday, to fix their covers.


Beyond all that, I am at an impasse now, with the ebooks that are not displaying a cover (just the default generic text based one). Anything else is purely a guess right now, and any possible solutions are too thin on the ground. I need to know more, about how the numbered sub-folder names are determined, and whether one or more database entries need creating or updating, and whether I can do that myself or not. I might even try contacting Kobo directly about those things or some of them. Before that, I might try contacting a few folk at the MobiRead Forum, but I suspect they will just recommend using calibre to add ebooks, which is not what I want to do, and I cannot do it properly from this old PC in any case, due to the version of calibre that can run on this PC.

If I cannot get the information I need, then in the end, I will need to just side-load all the remaining ebooks that have cover issues ... either with the DRM (preferred) or DRM-Free version of each ebook. That will likely mean needing to use the FIX COVERS process for each side-loaded ebook, which would be simple enough if I did not have such a flaky USB connection with my Kobo device.


Actually I have one idea remaining, that would not be difficult to try or investigate.

I have been working on the principle (hoping) that the number sub-folders already exist for every ebook. My presumption so far, is that they were hopefully the empty ones, which now doesn't seem to be the case, unless some kind of database entry needs to also exist. It would seem those empty folders might just be for ebooks that did exist on my Kobo but were removed, and then not cleaned up like they should have been. I've certainly had to remove many ebooks that were automatically copied to my device during a sync, that I did not yet want on my device (mostly freebies by unknown authors, but also some large graphic ebooks only suitable for a large tablet screen). The stupid sync process, when it works, always downloads the last five purchases, if they don't exist on your device.

it has occurred to me, that maybe it isn't about empty folders, but rather a folder with some kind of generic content, such that my program could not match anything. I'm going to think a bit more about that, and then maybe develop something. I am currently thinking that a kind of map (list) of every ebook and its sub-folder would be a handy thing. Basically this would be creating a sorted list of the content of every images sub-folder, to see what else gets revealed.


DOWNLOAD

Kobo Cover Fixer.au3  (45 downloads)  SEE THE FIRST POST in this topic for the latest version.
141.9 kB


FYI (maybe). Back in the earlier days of my Kindle ereader devices (E-Ink), I used to download every single ebook I purchased from Amazon, even the free ones by unknown to me authors. Eventually I ran out of space on my two Kindles, so I stopped downloading those free ones, and over time removed the ones already on my devices to claw back some storage space ... and I am still doing that, as I removed the less great seeming ones first. I decided to not make that mistake with my Kobo E-Ink device, so it is truly annoying that automatic process when syncing ... not smart to do that unnecessary file writing to my Kobo device drive either.

It is only the Kindle For PC app on my PC, that has a full list & download of every ebook purchase, as it is set as the default device for each ebook ... every ebook prior to January 1st 2023 that is, as I refuse to update to a version of Kindle For PC that won't run on this PC.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

On 6/15/2023 at 7:24 PM, TheSaint said:

Actually I have one idea remaining, that would not be difficult to try or investigate.

I've now actually coded something for this, and there is a real possibility that it might bear some fruit.

So far, just with several quick checks, I have discovered some folders containing covers for ebooks on my Kobo device that are not showing on my Kobo device. Clearly the Image ID value is different.

There are a lot of these folders, not belonging to ebooks on my Kobo device ... or at least not matching up in some cases with the Image ID values. Most of these images are for ebooks I own, but not yet on my device or for ebooks I don't own, but I have looked at at the Kobo store or have been targeted advertising to me.

A possible solution for me, depending on how these numbered sub-folders work, is to either copy the correct Image ID files to the matching folders or just rename to the correct Image ID what is already there. I can only try it and see what happens, as I have no idea why many of my ebooks on the Kobo are missing image files. I could hazard a guess or two.

One guess is that these particular ebooks were once on my Wishlist and so some kind of conflict happened when I subsequently bought them and downloaded them to my device. Or maybe a similar thing for those ebooks advertised to me or that I looked at while browsing.

My second guess, is it might be related to how I got the ebooks on my device, which in many cases, and all the time now, is a forced download, where I am pretending I want to read that ebook now. I've been doing that every time sync fails to work or downloads get stuck on pending. As sync currently doesn't work for me, that's how I currently get my latest purchases onto my Kobo device. Perhaps covers aren't added properly or correctly when I use this method of downloading. I need to investigate this further.

My new code isn't complete yet. I've added three new buttons to the 'Program Setting' window in a grouping called - Device Images Folder. The first creates a file list of every image folder that is occupied, and where it can, adds the Author and Title names to each. The second button shows that list as a plain text file, TAB delimited. The third button I am still working on, though it currently shows the list, sorted by Author & Title, in an _ArrayDisplay, along with column headers and a function that can be called for each selected row. The function executes the image for the selected row entry, though because the file extension is '.parsed' and not the '.jpg' it truly is, my image viewer program (IrfanView) always asks me if I want to rename to '.jpg'. This makes checking a pain. My intent is to have a GUI instead via that function, that will display multiple images that can be cycled to the next lot, one image for each ebook. It will probably show 20 cover image thumbnails at a time. This will allow me to very quickly discover things.

KCF_setup_5.png?raw=true

 

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

This is where I am now currently at.

Mapped.png?raw=true

 

At the moment I have decided on just showing 9 cover images at a time.
RESTART and NEXT buttons are working.
The true Author and Title will only show up when the Image ID matches with an ebook I own, that exists on my Kobo device.

As you can see in the screenshot, I have clicked the thumb image of the first ebook cover, which populates the Image ID, Author and Title fields, and also displays a larger preview image of that cover, which closes when the mouse moves enough.

I will probably add some button(s) and code to save the Author and Title to file, when the cover image is for an ebook on my device, that is missing cover images. It will likely also update the file for the array being displayed, so that on subsequent views the new data will be present, with some kind of indicator to differentiate from the working entries. I've not thought much beyond that yet, other than some way is needed to rename or insert the true Image ID into the discovered matching ebook sub-folders, which will hopefully work as the ultimate solution I need.

DOWNLOAD

Kobo Cover Fixer.au3  (50 downloads)  SEE THE FIRST POST in this topic for the latest version.
157.73 kB

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

On 5/31/2023 at 4:42 PM, TheSaint said:

I've added a bunch of things, and the Results window might well be in its final state (look) now.

ISR_5.png?raw=true

You've gotta laugh, at how much it has changed since I wrote that.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

I did further coding for the new option, but an eventual test I have just done, revealed nothing solved.

Here's some screenshots at various stages today.

Mapped_2.png?raw=true    Mapped_3.png?raw=true

Using the SUBS value as seen in the second screenshot, and then saving that to the subs input field on the Results window for a selected ebook with missing images, then clicking  the CREATE button, I was able to create the 3 required images in that subs folder on my Kobo device. I then rebooted the device, and checked that ebook, but the missing images issue was not solved (menu browsing or sleep cover).

Interesting to note, that the original three images in that subs folder (still there), have an Image ID in their file name, that does not exist in the device SQLite file. I was hoping the sub-folders were correct but the files were wrongly named ... not updated or something after I purchased the ebook in question. Alas that appears to be false.


My new code extracts detail from the device SQLite file and creates an INI file called 'Others.ini', that the Mapped Images Viewer can use if the values of Author etc are not returned from the 'Results.ini' file. Using what is or isn't returned, the new inputs for DEVICE and OWNED and SUBS, as well as AUTHOR and TITLE are populated. The larger preview image is now optional with a checkbox setting when a cover image is clicked. A few other minor improvements.


The only place I can think to go from here, is to sideload all the troublesome ebooks, which is something I prefer not to do, as that means giving up on Wifi for many ebooks and mucking around with connecting my Kobo device to a PC, and then fixing any images afterwards that are badly sized (formatted).

I still have the option of seeking help from Kobo Support or from some folk at the MobiRead Forums, but we will see. Time to do other things now for a while.

DOWNLOAD

Kobo Cover Fixer.au3  (47 downloads)  SEE THE FIRST POST in this topic for the latest version.
163.48 kB

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Tonight I decided to do a bit more code for this project for safety reasons ... a purely precautionary measure, and probably not needed.

Basically I wanted to remove all the Placebo image files from my Kobo device, but because I have downloaded more ebooks to it, and done a partial sync, I wanted to make sure the removal process did not remove more than it should. So to that end I added a basic count check, remembering that each empty image folder got given 120 placebo image files.

My original code just deleted all files in each previously empty folder that had the file extension '.parsed'. My new code builds on that with a count check of the first empty folder, reports that with a query about continuing with removals. If continue is selected by the user, then every other folder being processed does a count check comparison. A simple but probably suitable check, just in case other '.parsed' files have been added to one or more of the previously empty folders on my Kobo device. If the count doesn't match for a folder, then the user is shown the comparison result and prompted about continuing or not. This safety measure does not cater for any removals or replacements of placebo image files that the Kobo software may have done, but I consider that a highly unlikely occurrence. At worst, if that last thing ever did happen, then a cover replacement would be required. So really my safety measure is more a convenience measure, hopefully preventing any need for fixes.

As part of my code, I also belatedly realized that the REMOVE button process, like the other two placebo button processes, that had the disable/enable controls code added later, was also missing that, so I added that in ... as well as replacing the Splash message with status messages.

DOWNLOAD

Kobo Cover Fixer.au3  (45 previous downloads)  SEE THE FIRST POST in this topic for this latest version.
170.89 kB

P.S. It has also occurred to me, that my flaky USB issue with my Kobo device might be a driver issue on this PC. At some point I will check that with my new laptop. I seem to recall I did have to find and install a driver a couple of years ago for the Kobo device to get recognized. This PC well and truly predates Kobo devices.

P.S.S. Or maybe that driver was for my new phone. :lol: 

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...