-----------
INFORMATION
-----------

When working with your Kobo device drive, we are working with two folders '.kobo' and '.kobo-images'. Inside the '.kobo' folder is your 'KoboReader.sqlite' file, which amongst many other things, lists all the ebooks on your Kobo device, along with details about those ebooks. Inside the '.kobo-images' folder are numbered sub-folders that contain all the image files for your ebooks and various adverts. Those image files are JPG files, but use the '.parsed' extension instead of '.jpg'. If manually checking them, be careful they don't have that extension renamed by your viewing program.

Cover image file issues generally stem from two things. The first is cover images being lost during Sync, for no reason that I've ever been able to determine, so probably just due to an unfixed bug. The second issue is related to imported (side-loaded) ebooks, which for some reason often result in black & white versions of the cover, as well as the cover image being reduced in size visually, as in a small version of the cover being embedded at top left in a blank larger image. That last happens regardless of a decent sized color image embedded in the ebook.

Imported ebooks are also known as side-loaded ebooks. These are ebooks you have manually copied to yur Kobo device, that don't have DRM. They can be copied directly to the root of the drive, but should really be in one of more sub-folders, so that browsing the drive is easier, less messy. I typically create a folder called 'Imported' or 'Imported Ebooks' and add ebook files to author sub-folders inside that. When you turn on your Kobo device or awake it, those ebooks are discovered and imported. NOTE - I don't discuss or deal with ebooks added to your Kobo device by a program such as calibre.

------
ADVICE
------

For usage of the 'Kobo Cover Fixer' program to be truly effective, some basic steps need to be followed. Those steps should free you from any confusion and help speed things up. First time use differs a bit from subsequent usage.

The following instructions cover the basics, but other options also exist, some via right-click menus etc.

PLEASE READ AHEAD slightly, before starting on any next step, especially any accompanying NOTE.

-----------------
FIRST USAGE STEPS
-----------------

1. Extract the 'Kobo Cover Fixer' zip file to a good location on your PC.

NOTE - Not all files extracted are required, unless you intend to develop the program further or have a general interest in the code. So the 'Original Python Script' folder can be deleted, along with the following files - DisplayArray.au3, Fixer.ico, GDIP.au3 and Kobo Cover Fixer.au3.

2. Run the extracted file 'Kobo Cover Fixer.exe', which will present you with a floating dropbox.

3. If you haven't done so already, connect your Kobo device via USB, and browse that drive.

4. Drag & Drop the '.kobo' folder onto the dropbox.

NOTE - The 'KoboReader.sqlite' file inside of that will be discovered and then read, and depending on the number of ebooks on your Kobo device, this could take a while, and involves creating a list of ebooks with select information about them, for the 'Kobo Cover Fixer' program to use. During that process, any missing image files (covers) for a listed ebook are discovered and taken note of. Each ebook listed, should have three image files, that vary in dimensions, from large to small, and play three different visual roles on your Kobo device. Those image files are inside numbered sub-folders within the '.kobo-images' folder.

5. When the reading and scanning folders process has finished, close the dropbox.

6. You are then presented with a timed query, which can be ignored or just click OK.

NOTE - The main program window has opened, and the list of ebooks and their detail is being loaded. If a lot of ebooks, then this can take a while. When the loading of the 'Ebooks List' has finished you are now ready to work with the listed entries.

7. OPTIONAL STEP. It is perhaps recommended at this point, to click on the BACKUP IMAGES button, to create a backup.

NOTE - This could be helpful, if things go wrong. This process creates a 'Backups' sub-folder where the 'Kobo Cover Fixer.exe' is located, inside an 'Ebook Covers' sub-folder. So ensure you have enough space for this, as it could amount to a few hundred megabytes. Basically you get author named sub-folders created inside the 'Backups' sub-folder, to which ebook cover image files are copied from your Kobo device, as per the 'Ebooks List'.

8. You are now ready to work individually, with the listed entries (see that section below).

9. After you have finished working with the entries, continue to the next step.

10. Click on the CLONE button, and follow instructions in regard to setting a 'Clone Images Folder'.

11. Choose the 'Clone' option from the query that is presented, not 'Restore'.

NOTE - This initiates a copy process, that can take quite a while. Basically, all image files in the numbered sub-folders on your Kobo device, inside the main '.kobo-images' folder, are copied and their sub-folders duplicated inside your new 'Clone Images Folder' on your PC. WARNING - Ensure there is enough space before starting, as it can amount to several hundred megabytes, depending on the number of ebooks etc. The image files consist of those for the ebooks on your Kobo device, plus various adverts.

12. Click on the REMOVE ADVERT IMAGES button.

NOTE - This process gets a list of image files for all the ebooks on your Kobo device, and compares the image files in the 'Clone Images Folder' with that, removing any that aren't listed. This can reduce the amount of storage used, and it will also make any future 'Restore' process quicker. This process can maybe take up to a minute or so, depending on your PC and number of image files in the clone folder and your number of ebooks.


----------------------
SUBSEQUENT USAGE STEPS
----------------------

1. Run the extracted file 'Kobo Cover Fixer.exe', which will present you with a floating dropbox.

2. Close the dropbox.

3. Click CANCEL on the query that is presented.

NOTE - At this stage, we don't need the 'Ebooks List' to be populated, and it would just waste time to do so.

4. If you haven't done so already, connect your Kobo device via USB.

5. Click on the CLONE button, and accept the setting (location) for the 'Clone Images Folder'.

6. Choose the 'Restore' option from the query that is presented, not 'Clone'.

NOTE - This initiates a copy process, from the 'Clone Images Folder' to your Kobo device, which can take quite a while. You will also likely be queried for a KEEP or REPLACE button response in a visual window. The process compares image files on your Kobo device, with image files in your 'Clone Images Folder', and where there isn't a match, asks you what you want to do. When such a query comes up, pay very close attention to what image is where, and choose on the basis of that, whether to KEEP or REPLACE. You do also have the option of selecting 'Keep All' or 'Replace All', which prevents any further queries, and it is certainly a much faster process if you do either, but might result in unwanted results, though 'Keep All' is maybe preferred over 'Replace All', as any issue is likely easier to fix. In any case, image files that matched aren't replaced and missing image files are always copied over.

7. After the 'Restore' process has finished, you will be queried about restarting the program, which is usually a yes.

8. After the program restarts, you are back to the dropbox.

9. If you haven't already browsed your Kobo device drive, do so now, maybe using that right-click option of the dropbox.

10. Drag & Drop the '.kobo' folder onto the dropbox.

11. When queried, choose the 'Update' option.

NOTE - The 'KoboReader.sqlite' file inside of that will be discovered and then read, and depending on the number of ebooks on your Kobo device, this could take a while, and involves creating a list of ebooks with select information about them, for the 'Kobo Cover Fixer' program to use. During that process, any missing image files (covers) for a listed ebook are discovered and taken note of. Each ebook listed, should have three image files, that vary in dimensions, from large to small, and play three different visual roles on your Kobo device. Those image files are inside numbered sub-folders within the '.kobo-images' folder.

12. When the reading and scanning folders process has finished, close the dropbox.

13. You are then presented with a timed query, which can be ignored or just click OK.

NOTE - The main program window has opened, and the list of ebooks and their detail is being loaded. If a lot of ebooks, then this can take a while. When the loading of the 'Ebooks List' has finished you are now ready to work with the listed entries (see that section below). Before doing that though, you might want to consider using the optional BACKUP IMAGES process, as mentioned in Step 18 below, though you can just do that last if you want. That process result might help if things go wrong sometime.

14. After you have finished working with the entries, continue to the next step.

15. Click on the CLONE button, and accept the setting (location) for the 'Clone Images Folder'.

16. Choose the 'Clone' option from the query that is presented, not 'Restore'.

NOTE - This initiates a copy process, from your Kobo device to the 'Clone Images Folder', which can take quite a while. You will also likely be queried for a KEEP or REPLACE button response in a visual window. The process compares image files on your Kobo device, with image files in your 'Clone Images Folder', and where there isn't a match, asks you what you want to do. When such a query comes up, pay very close attention to what image is where, and choose on the basis of that, whether to KEEP or REPLACE. You do also have the option of selecting 'Keep All' or 'Replace All', which prevents any further queries, and it is certainly a much faster process if you do either, but might result in unwanted results, though 'Keep All' is maybe preferred over 'Replace All', as any issue is likely easier to fix. In any case, image files that matched aren't replaced and missing image files are always copied over. WARNING - Ensure there is enough space before starting, as it can amount to several hundred megabytes, depending on the number of ebooks etc. The image files consist of those for the ebooks on your Kobo device, plus various adverts.

17. Click on the REMOVE ADVERT IMAGES button.

NOTE - This process gets a list of image files for all the ebooks on your Kobo device, and compares the image files in the 'Clone Images Folder' with that, removing any that aren't listed. This can reduce the amount of storage used, and it will also make any future 'Restore' process quicker. This process can maybe take up to a minute or so, depending on your PC and number of image files in the clone folder and your number of ebooks.

18. OPTIONAL STEP. It is perhaps recommended to click the BACKUP IMAGES button, to create/update an additional backup.

NOTE - This process, if needed, creates a 'Backups' sub-folder where the 'Kobo Cover Fixer.exe' is located, inside an 'Ebook Covers' sub-folder. So ensure you have enough space for this, as it could amount to a few hundred megabytes. Basically you get author named sub-folders created, if needed, inside the 'Backups' sub-folder, to which ebook cover image files are copied from your Kobo device, as per the 'Ebooks List'.


---------------------------
WORKING WITH LISTED ENTRIES
---------------------------
Basically, this is where we fix cover issues, that haven't been fixed by the clone 'Restore' option, if used. Typically we can add missing covers, using existing ones found within the program folder's sub-folders, though in some cases sourced elsewhere first. In the case of imported (side-loaded) ebooks, we are maybe needing to do a replace, rather than a copy. So except when doing a straight copy, generally we are creating the required image files for add, using a single largish source file to create the three required files of different dimensions.

1. Select the first (top) entry on the 'Ebooks List'.

2. Enable the NEXT button checkbox. This needs to show a tick not filled block at this point.

3. Click that NEXT button.

NOTE - This should take you to the first entry, that has at least one missing image file, scrolling the list if needed.

4. If a cover image file has become selected in the 'Cover Images - Source' list, and it is correct (what you desire), then click the DETERMINE (or other) button and follow prompts. If however, no cover image file is available, you need to source one and add it to the program, having it placed within the 'Ebook Covers' sub-folder, where it will be shown in the 'Cover Images - Source' list, perhaps after clicking the small refresh button at left. If necessary, see ADDING SOURCE IMAGES below.

NOTE - If a listed ebook is missing all images, then usually the required numbered sub-folders are unknown and need to be determined and created on your Kobo device. In the case of one or more missing image files for the selected ebook, the DETERMINE button will do all that is necessary - missing sub-folders determined and created and missing files created and copied across, and then the next suitable entry on the 'Ebooks List' is selected.

5. Repeat Step 3 and Step 4 until finished with ebooks that have missing image files.

6. Once all the ebook entries with missing image files have been dealt with, we move onto fixing other image issues.

NOTE - To discover other entries with image issues, we need to work our way through every entry on the 'Ebooks List'. It involves visual checking, and the process can be semi-automated for imported (side-loaded) ebooks.

7. Now we check on Imported (side-loaded) ebooks, by first selecting the first (top) ebook entry on the 'Ebooks List'.

NOTE - If you don't have any imported ebooks on your Kobo device, then this can be skipped, and unless you want to manually check every entry on the 'Ebooks List', you are probably done (except for Clone and Backup processes).

8. We now right-click the 'Ebooks List' and select the 'Enable NEXT for Imported' menu option. This changes the black text on the NEXT button to green.

9. We now click the NEXT button to just step through all the Imported Ebooks on the 'Ebooks List'.

NOTE - As each entry gets selected, we see the existing cover image displayed in the 'Cover Image' preview field. And if a suitable image exists in the 'Ebook Covers' folder, then that entry gets selected in the 'Cover Images - Source' list. If you want, you can click on the preview image and see a full size version. IMPORTANT - For this to work, one of the 'Image File' dropdown entries needs to be either 'Image 1' or 'Image 2' or 'Image 3', otherwise you aren't seeing the image on your Kobo device. You can also check out the full size version of any cover image file selected in the 'Cover Images - Source' list, by clicking on that selected entry.

10. With a suitable (desired) image file entry being selected in the 'Cover Images - Source' list, we could now click the FIX COVERS button, to replace existing image files if necessary.

NOTE - If there is an image file issue, and no suitable entry exists on the 'Cover Images - Source' list, then follow the instructions found below in the ADDING SOURCE IMAGES section. Do that, then return to Step 9.

11. Repeat Step 9 and Step 10 until finished with Imported Ebooks.

12. You could at this stage, visually check out all the other ebooks, but that may be unnecessary, unless you are aware of an issue or want to replace a cover image you don't like with a cover image you do.

NOTE - If you do decide you want to check out the other ebook entries, then just follow Step 10 for them, but perhaps use the larger ADD or CREATE buttons, instead of the FIX IMAGES button. You can also use the large arrow buttons to easily step through the listed entries.

13. Once all entries are fixed to your satisfaction, then we want to 'Clone' what we have done, to assist with next time. See from Step 11 (FIRST USAGE) or Step 15 (SUBSEQUENT) in those sections above.

NOTE - With SUBSEQUENT USAGE, it may also be smart to use the BACKUP IMAGES button process, either before or after this usage section.


--------------------
ADDING SOURCE IMAGES
--------------------
Fixing cover image file issues, mostly works on the basis of providing cover image files. These can be sourced wherever you like, and copied to the 'Ebook Covers' sub-folder. There are also ways to semi-automate that. Typically I source my image files from book covers available in the library folders of the calibre cataloging program, which you would need to have already set up, of course.

You can source your cover image file and add it directly to the 'Ebook Covers' sub-folder. Then you click the refresh button to have the image file show up in the 'Cover Images - Source' list. However, naming is very important for ease of use.

The way to semi-automate both the adding and naming, is to select your ebook on the 'Ebooks List', then drag & drop your source image file onto the 'Cover Image' preview field. You then click that ebook entry again, and teh added image file should be selected in the 'Cover Images - Source' list.

Once the image file has been successfully added to the 'Cover Images - Source' list, and selected, you are ready to click the DETERMINE button. Or instead, you can click the FIX COVERS button or the large ADD and CREATE buttons. These other buttons generally do a copy & replace, unlike the DETERMINE button which just does a simple copy. All the buttons create correct size image files first though ... size not only being file size but image dimensions.

IMPORTANT - Any source cover image file, should be a decent one, as it will be used for converting to three different file sizes and image dimensions. So a largish good quality image file is needed.
