AddKindleMediaQueries
A Sigil Plugin
Optimally formats all epub images both for KF7 devices(in pixels) and KF8 devices(as a %)
Requirements
Plugin Type: Edit
Minimum Sigil requirement: v0.9.3 or higher
Python Requirements: Python 3.4+ (Bundled or External)
OS Requirements: Windows, Linux or OSX
Current Version: "0.1.0"
*** Tested on Windows 7, 8 & 10 only ***
Installation
* Select Manage Plugins from the Plugins menu. In the dialog box, select either the Bundled Python or the External Python(Python 3.4+ should be installed on your computer to run this plugin externally).
* Click Add Plugin and select AddKindleMediaQueries_vXXX.zip. This will load and install the plugin into Sigil, which you can then select and run the plugin by selecting Plugins > Edit > AddKindleMediaQueries
Description
This simple plugin is an edit plugin that adds media queries to the appropriate stylesheet and converts and duplicates all ebook images for display on KF7 devices(in pixels) and images for display on KF8 devices(as % values) At runtime the media queries in the stylesheet then decides which image line to run on the current device(depending on whether it is a KF7 or KF8 device). This plugin should only be used for standard epubs only(not epub 3). So the man purpose of this plugin is to give proper and optimal image rendering for all ebook images on both KF7 deivices(in pixels) and KF8 devices(as a %).
User Options(via dialog):
* Select stylesheet for media queries
This is an option dropdown list that allows you to select the right stylesheet from your epub to add the media qeuries. The stylesheet that you choose should be the main stylesheet that is used to style all text files and images in your epub.
* Enter your prefered base width value
This text entry option allows you to type in your own preferred base width value for the % calculation. This value is used to calculate the percentage width of the images for KF8 devices only. The calculation is shown below.
image-width-in-pixels/630 x 100
The 630px value is the default base width option(or default screen width option). So the user has the option of either typing in a larger or smaller base width value or the user can just use the default -- 630px.
Plugin Run
First load your epub into Sigil and then just run this plugin.