38489 Commits

Author SHA1 Message Date
NiLuJe
7c02419eed Start addressing review comments
Explicit cast to float is superfluous, thanks to __future__.division
2019-06-03 14:09:49 +02:00
Kovid Goyal
cff789f12c
Modernize the code used to interact with macOS
Recycle bin and notifications code. The old recycle bin code was
deprecated. Notifications support has been moved in-process.
2019-06-03 13:37:51 +05:30
NiLuJe
04c7a8aa4a Make the GCC 4.8 bot happy ;). 2019-06-02 20:44:00 +02:00
NiLuJe
aaa2fa936a Use a lower compression level for the first PNG pass
optipng will fix it anyway
2019-06-02 18:29:50 +02:00
NiLuJe
cc8a3b4450 Refactor that to avoid code duplication 2019-06-02 18:29:50 +02:00
NiLuJe
8e7b519b8d Inline the grayscaling pass in ordered_dither
Saving one QImage pixel-loop dance in the process...
2019-06-02 18:29:50 +02:00
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
b5230d9bd8
py3: more unicode porting 2019-06-02 14:33:27 +05:30
Kovid Goyal
edc32ecdbd
Merge branch 'master' of https://github.com/davidfor/calibre 2019-06-02 09:21:49 +05:30
David
469e8cfb55 Correct handling of ContentType for newer Kobo firmware.
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.
2019-06-02 13:01:12 +10:00
Kovid Goyal
7d81b1dddf
Fix for ContentType not being defined error for extension-less non kepub files on a Kobo 2019-06-01 21:34:10 +05:30
Kovid Goyal
e049c10729
py3: Port a few remaining chr() calls 2019-06-01 15:21:01 +05:30
Kovid Goyal
c83cdcf086
py3: More unicode porting 2019-06-01 15:16:57 +05:30
Kovid Goyal
151e736538
py3: more unicode porting 2019-06-01 14:47:05 +05:30
Kovid Goyal
20b065fb49
py3: Various fixes for the last py3 merge 2019-06-01 12:37:04 +05:30
Kovid Goyal
d9fcdbe1a2
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-06-01 08:34:49 +05:30
Kovid Goyal
a0a3f89820
Content server: Book details page: Do not display empty rows for undefined dates 2019-06-01 08:32:57 +05:30
Kovid Goyal
949ac56a5c
Get books: Update Google books plugin for markup changes 2019-06-01 08:07:58 +05:30
Kovid Goyal
64141ab21f
Edit book: Text search: Fix searching for a single character backwards not working 2019-06-01 07:57:18 +05:30
Kovid Goyal
36604c52ee
Forgot to bump plugin version 2019-06-01 07:28:53 +05:30
Kovid Goyal
e0e20c7872
Get books: Fix amazon plugin for change to amazon results page markup 2019-06-01 07:28:10 +05:30
Kovid Goyal
0167613cdb
Build GNU autotools on macOS, needed for mozjpeg 2019-06-01 07:17:35 +05:30
Kovid Goyal
cea430cb78
Remove login from Boston Globe
It now uses Javascript to login, and given that
it works without login I cant be bothered to implement it.
2019-06-01 07:14:58 +05:30
Eli Schwartz
fbba92281d
py3: fix reading bytes and trying to write in text mode 2019-05-31 16:17:50 -04:00
Eli Schwartz
9a169c86c7
remove unused code
This function is no longer used since commit 4cd285859b6721c48eefd9b23fe47b0bfc5ab871
2019-05-31 16:17:50 -04:00
Eli Schwartz
4049c93c2f
fix miscellaneous typo 2019-05-31 16:17:50 -04:00
Eli Schwartz
e521e770f3
py3: more __future__s 2019-05-31 16:17:50 -04:00
Eli Schwartz
0cee082978
use contextmanagers for open() 2019-05-31 16:17:50 -04:00
Kovid Goyal
cb28cf5d92
Bump versions of nasm and cmake 2019-05-31 17:03:01 +05:30
Kovid Goyal
4b5903eb42
Data for macOS builder 2019-05-31 16:39:37 +05:30
Kovid Goyal
2aa8acff15
Download sources without using git 2019-05-31 10:32:52 +05:30
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