I recently wanted to convert an AZW3 comic to EPUB because I prefer EPUB as a free format. However, no matter how much I tried to get Calibre to do the conversion with various output settings, it always distorted or clipped the images. I tried to brute-force my way through the settings after deliberately choosing settings. Not even heuristic processing helped in any way. So I decided that there has to be another feasible way to convert. I consulted the interwebz and I found several sites that claimed to do what I want for free. I tried a few of them but they all produced the same terrible results.
That is when I found a forum post in a longer thread about a work around. It took some time to find this (rather crude description of a) solution so I decided to post a small tutorial on my blog. Keep in mind that this workaround will produce an EPUB that has only a cover image and the included images from the comic. No table of contents or other fancy things – I might add another post if I ever come around to play with the editor again. Prerequisites for this little guide is that you have a Linux installation with Calibre and the included ebook viewer and editor.
- Locate your ebook in the AZW3 format.
- Open it with Calibre’s ebook editor.
- Select all the images inside the ebook and export them to a folder on your hard disk that you can find.
- Open a terminal on your computer and cd into the folder with the images.
- Run the two following commands to first create a markup *.txt file with the necessary information and then a new EPUB file from the txt.
- After creating the EPUB file you can open it again with the ebook editor.
- Select the image inside the file to be the cover image and then go to “Tools -> Add Cover” – this sets the image as cover and updates all the necessary references inside the file. If you want you can run the check as suggested by the tool.
>>> for i in *.jpeg; do echo \![$i]\($i\); done > alljpegs.txt
>>> ebook-convert alljpegs.txt alljpeg.epub --output-profile tablet --formatting-type markdown
Congratulations you are done now. After you saved your new EPUB file you can import it into Calibre, update the meta information and transfer it to your ebook reader.
Thank you, your comment successfully submitted
your comment has been submited, it might take a while to be moderated.