38106 Commits

Author SHA1 Message Date
NiLuJe
4326bb9d7f Unify indentation style 2019-06-02 18:29:50 +02:00
NiLuJe
c465d7f4e7 Tweak copyright header a bit, now that it's done 2019-06-02 18:29:50 +02:00
NiLuJe
227b5f97bd Stick the commented out Indexed8 code in there, for posterity's sake (in
preparation of a squash)
2019-06-02 18:29:50 +02:00
NiLuJe
d2772a2916 Eh, okay-ish optipng compromise 2019-06-02 18:29:50 +02:00
NiLuJe
bdb767c9b7 Forget about optipng
Granted, it helps, but it's prohibitively expensive.
2019-06-02 18:29:50 +02:00
NiLuJe
d6efb350bf Experiment w/ optipng... 2019-06-02 18:29:50 +02:00
NiLuJe
b5554bd0da Revert "See what happens if we switch to Indexed8..."
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 :/.
2019-06-02 18:29:50 +02:00
NiLuJe
38ad6a5b2d See what happens if we switch to Indexed8... 2019-06-02 18:29:50 +02:00
NiLuJe
96a98bbc29 Fix syntax error 2019-06-02 18:29:50 +02:00
NiLuJe
4f754d518a I should probably have tried to build that first xD 2019-06-02 18:29:50 +02:00
NiLuJe
81b303aa18 Tweak help messages a bit 2019-06-02 18:29:50 +02:00
NiLuJe
5e7907b0aa Ups, actually Grayscale8, as I'm not writing a palette...
Let's see what QImageWriter makes of that before checking if I really
need to bother with Indexed8...
2019-06-02 18:29:50 +02:00
NiLuJe
90ab7573d9 Return an Indexed8 QImage
Ensures it'll be encoded as such when saved as a PNG
2019-06-02 18:29:50 +02:00
NiLuJe
7e6347486b Port ImageMagick's OrderedDither algorithm, and use that instead of
ImageOps' quantize to dither images to the eInk palette.

It works much better for our intended purpose, and it's pretty fast.
2019-06-02 18:29:49 +02:00
NiLuJe
cf1b855ea0 Rejig thumbnail dimension calculations
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.
2019-06-02 18:29:49 +02:00
NiLuJe
1f0bc97a15 Update thumbnail dimensions, based on @geek1011's findings
c.f., https://github.com/shermp/Kobo-UNCaGED/issues/16#issuecomment-494229994
2019-06-02 18:29:49 +02:00
NiLuJe
832ab64c63 Greater control over Kobo covers processing.
* 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.
2019-06-02 18:29:49 +02:00
Kovid Goyal
c415bb9f08
version 3.44.0 v3.44.0 2019-05-31 09:18:11 +05:30
Kovid Goyal
844494379c
Add rsync to vm settings 2019-05-31 08:25:17 +05:30
Kovid Goyal
6debb61ba2
... 2019-05-31 08:24:56 +05:30
Kovid Goyal
7931cf637a
py3: More unicode porting
Fix some byte handling in zipfile and also avoid using chdir in it
2019-05-30 18:02:18 +05:30
Kovid Goyal
02f6c2f47b
Fix unicode porting breaking dbus_service.py 2019-05-30 09:36:47 +05:30
Kovid Goyal
831a938855
py3: More unicode porting 2019-05-30 09:23:58 +05:30
Kovid Goyal
c03fad6f5d
... 2019-05-30 07:28:56 +05:30
Kovid Goyal
3e2161df68
Driver for the new NOOK Glowlight Plus 2019-05-29 19:16:18 +05:30
Kovid Goyal
8a934e19c6
Merge branch 'master' of https://github.com/davidfor/calibre 2019-05-29 19:10:22 +05:30
David
7317c4a4e8 Bump supported Kobo firmware version 2019-05-29 23:05:26 +10:00
Kovid Goyal
85017dccc0
py3: Port windows recycle bin code 2019-05-29 18:11:29 +05:30
Kovid Goyal
cae30d8795
Dont scan smtplib.py in the porting utils 2019-05-29 17:58:23 +05:30
Kovid Goyal
4730fce41b
py3: More unicode porting 2019-05-29 17:55:26 +05:30
Kovid Goyal
06dc7dd15b
Dont scan Zeroconf.py in the porting utils
This is being replaced by upstream zeroconf in py3
2019-05-28 12:41:48 +05:30
Kovid Goyal
d87529e9d2
Amazon metadata plugin: Fix searching the amazon servers directly not working because of changed markup 2019-05-28 10:46:38 +05:30
Kovid Goyal
a869af5d62
Fix incorrect date for latest release 2019-05-28 10:37:02 +05:30
Kovid Goyal
5d61f5e8fd
version 3.43.0 v3.43.0 2019-05-28 09:31:11 +05:30
Kovid Goyal
422537926d
py3: Calls to UUID(hexkey) require strings
Also various misc cleanups I came across while reviewing the last py3
merge PR
2019-05-28 09:13:21 +05:30
Kovid Goyal
015ff1611b
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-05-28 07:42:30 +05:30
Eli Schwartz
b9a99c271b
py3: more work towards universal __future__s 2019-05-27 16:14:30 -04:00
Eli Schwartz
ac6bd5e0fd
etree: use encoding='unicode' instead of passing unicode_type object 2019-05-27 16:14:30 -04:00
Eli Schwartz
b5eda37c75
use contextmanagers for open() 2019-05-27 16:14:30 -04:00
Eli Schwartz
94db9b84cd
reindent lines for neatness 2019-05-27 16:14:30 -04:00
Eli Schwartz
651fdaa129
py3: cleanup some str() calls in ported code.
They're usually not needed as they are casting things we already know
are (unicode) strings.
2019-05-27 16:14:30 -04:00
Eli Schwartz
991c913bb2
use bytestring directly for file template
Don't bother storing it as a u'' string, then doing nothing with it
other than encoding it to write it to a file.
Also touch up use of open() to close the file via a contextmanager.
2019-05-27 15:24:28 -04:00
Kovid Goyal
4ed839f595
py3: More unicode porting 2019-05-27 20:43:20 +05:30
Kovid Goyal
6e0ec5b65c
Get an accurate count for how many files are left that need unicode porting
555 left currently, sigh.
2019-05-27 20:43:01 +05:30
Kovid Goyal
2b5db3ba24
Use HEAD to build qt-webkit
Upstream has several needed patches but shows no signs of wanting to
make a release.
2019-05-27 20:20:44 +05:30
Kovid Goyal
3f03ad698a
oops 2019-05-27 16:55:13 +05:30
Kovid Goyal
b842fe758a
Fixes for f2e0181926 2019-05-27 14:25:52 +05:30
Kovid Goyal
fe5aac9d97
Fixes for 89e2638cdd 2019-05-27 12:44:29 +05:30
Kovid Goyal
a2c4d44688
Fix a regression in 4d547f40e7
Without the bytearray() c will not be an integer on python2
2019-05-27 11:05:49 +05:30
Kovid Goyal
3cba654949
Put back __future__ imports that were accidentally removed in 45ca4c7934 2019-05-27 11:03:09 +05:30