This reverts commit a602b8b872c5b4c4c0772b82bb43e2384d92fd63.
What happens is we end up with an alpha channel in our PNGs, which
screws with our first entry in the palette: black, which is no longer at
full opacity :/.
Instead of bounding the the requested values, we *expand* around those,
like downloaded thumbnails for store-bought KePubs.
Also handle wonky landscape source ARs properly while we're there.
* Optional dithering down to the exact eInk color palette.
Note that, on some devices, FW >= 4.11 will do a much better job of it
than us.
That's true on the H2O, for instance, but not on the Forma, where it
only does so on thumbnails, not on the sleep cover...
When it does, grayscaling is done in sRGB space, and not linear light,
like we do, but that's a much more minor issue, and one where no-one
is actually wrong ;).
Depends on B&W covers to avoid nonsensical results.
* Optional letterboxing of full-screen covers to avoid extra Nickel
processing.
Depends on Keep AR to avoid nonsensical results.
* Optional storage as PNG to avoid JPG wrecking the dithering
Depends on B&W covers to avoid storing stupidly large color PNGs.
* Fix rounding errors when calculating thumbnail sizes:
AR should be a float, and we want to honor the *height* expected by
Nickel when there's potential for rounding mistakes (which is pretty
much always for thumbnails, given that the perfect AR should be 0.75).
Meaning we'll want to round properly before truncating ;).
* Fix thumbnail sizes on the Forma. Apparently, quite a few bits of the
FW behave as if the screen was Aura One sized...
Try to do it right on our end instead of following suit ;).
Unfortunately, full-screen cover processing is slightly broken on
nickel's side right now:
it appears to be treating them as Aura One sized, which incurs an
ugly and unavoidable scaling pass, one way or the other...
c.f., http://www.mobileread.com/forums/showpost.php?p=3025725&postcount=225
and the few pages around it.
The py3 changes highlighted an error in how the ContentType was being
handled. This should have been fixed ages ago.
Also fixed an issue with the Language column and old firmware/database
versions.