Commit graph

127 commits

Author SHA1 Message Date
Robin Whittleton
6b3863ff18 Add cavif LICENSE file as required 2022-09-18 22:08:19 +02:00
Robin Whittleton
71b675331a Fix AVIF images in iOS16 (and 8+ times speedup of AVIF generation)
iOS16 upholds AVIF standards more strictly than other renderers, which means that the current AVIF images on SE are broken. A fix for generation bug has been added to go-avif (https://github.com/Kagami/go-avif/pull/17) but we can do better.

This PR switches out the AVIF generation to cavif (https://github.com/kornelski/cavif-rs) which not only doesn’t suffer from the iOS16 but drops generation time by more than 8 times. For example, here’s a set of three timed runs in both go-avif and cavif on the title card of https://standardebooks.org/ebooks/jonathan-dymond/an-inquiry-into-the-accordancy-of-war-with-the-principles-of-christianity:

```
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./go-avif -e "illustration.jpg" -o "illustration-go-1.avif" --best

real	0m31.191s
user	1m39.113s
sys	0m1.662s
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./go-avif -e "illustration.jpg" -o "illustration-go-2.avif" --best

real	0m33.097s
user	1m49.846s
sys	0m0.831s
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./go-avif -e "illustration.jpg" -o "illustration-go-3.avif" --best

real	0m36.963s
user	2m4.235s
sys	0m0.711s

root@f58fb0beac90:/standardebooks.org/web/scripts# time ./cavif --quality 50 "illustration.jpg" -o "illustration-cavif-1.avif"
illustration-cavif-1.avif: 98KB (96840B color, 0B alpha, 242B HEIF)

real	0m4.017s
user	0m11.600s
sys	0m0.051s
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./cavif --quality 50 "illustration.jpg" -o "illustration-cavif-2.avif"
illustration-cavif-2.avif: 98KB (96840B color, 0B alpha, 242B HEIF)

real	0m4.083s
user	0m11.857s
sys	0m0.091s
root@f58fb0beac90:/standardebooks.org/web/scripts# time ./cavif --quality 50 "illustration.jpg" -o "illustration-cavif-3.avif"
illustration-cavif-3.avif: 98KB (96840B color, 0B alpha, 242B HEIF)

real	0m4.237s
user	0m12.339s
sys	0m0.093s
```

The executable has been generated via cargo, and has the following qualities:

```
root@f58fb0beac90:/standardebooks.org/web/scripts# file cavif
cavif: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f972071996c58b7a855d04e4c5804f4a3d94f575, for GNU/Linux 3.2.0, with debug_info, not stripped
```

I’m not sure how cavif’s quality 50 matches go-avif’s best flag, but they produce similar file sizes and similar visual quality.

There is a slight different in apparent colour space. If this is an issue there are tweaks, but according to the documentation it makes files larger so should be avoided. Given that the titlecards will matches the covers I see no reason to go down that path.
2022-09-18 22:01:26 +02:00
Alex Cabal
7071504034 Remove logging code 2022-07-24 18:33:07 -05:00
Alex Cabal
9e202c4f49 Update wanted ebooks list 2022-07-18 15:46:37 -05:00
Alex Cabal
6543658e45 Tweak output in deploy ebook script 2022-07-15 10:54:15 -05:00
Alex Cabal
e857e4e9e6 Rebuild web caches immediately on ebook updates 2022-07-14 15:28:57 -05:00
Alex Cabal
4baea8536d chown/chmod files during deploy within their correct scripts, instead of in the parent deploy script 2022-07-13 11:25:06 -05:00
Alex Cabal
a9aa560dd3 Don't refresh caches when deploying ebooks if there are more items in the build queue 2022-07-13 02:44:44 -05:00
Alex Cabal
47a5d3cd02 Use copy/unlink instead of rename when generating bulk downloads 2022-07-13 02:44:30 -05:00
Alex Cabal
dc0e873577 Add feed/download toolbar to author and collection indexes 2022-07-12 10:24:41 -05:00
Alex Cabal
05e0f77b45 Add collections and authors RSS/Atom/OPDS feeds 2022-07-11 18:49:11 -05:00
Alex Cabal
0bc3dc3830 Create cookie-based login and authentication system 2022-07-10 20:53:20 -05:00
Alex Cabal
45221365b5 More work on bulk downloads 2022-07-10 14:48:58 -05:00
Alex Cabal
fc1db3a3d4 Break bulk downloads into sections, add authors bulk download, and refactor bulk download generation code 2022-07-10 12:56:28 -05:00
Alex Cabal
7f50f00b42 work 2022-07-10 00:55:24 -05:00
Alex Cabal
76a4c34688 Move items out of the 'patrons-circle' folder into the root 2022-07-09 20:09:40 -05:00
Alex Cabal
12b79b5dcd Split bulk downloads into file type and cache output 2022-07-09 20:09:40 -05:00
Alex Cabal
4300619383 Normalize contents of webroot variables 2022-07-09 20:09:39 -05:00
Alex Cabal
7c087e0e13 PHPStan tweaks 2022-07-09 20:09:39 -05:00
Alex Cabal
dbc2fd5fcd Improve bulk downloads page 2022-07-09 20:09:39 -05:00
Alex Cabal
8090f3f9f7 Add bulk download page 2022-07-09 20:09:39 -05:00
Alex Cabal
6c603016bd Move feeds behind Patrons Circle login 2022-07-09 20:09:39 -05:00
Alex Cabal
fa8fa4f7eb Send email to the admin when a new patron joins 2022-07-09 12:26:32 -05:00
Alex Cabal
727e1af67d Update user in database if they exist when processing a payment 2022-07-04 15:31:16 -05:00
Alex Cabal
011cd747f1 Convert newsletter to use Users table as base 2022-07-04 12:09:49 -05:00
Alex Cabal
3fa9592e6d Send an email to lapsed patrons 2022-07-02 16:45:23 -05:00
Alex Cabal
0875e697b4 Change secrets from being stored in flat files to being stored in PHP INI configuration 2022-07-02 13:36:46 -05:00
Alex Cabal
5f0b57f7e9 Fix wrong test when processing payments 2022-06-30 09:57:05 -05:00
Alex Cabal
c2cf6ef455 Change 'modified' property to 'updated' for consistency 2022-06-29 18:55:51 -05:00
Alex Cabal
32206f3cd7 Improve handling of returning patrons 2022-06-29 18:05:49 -05:00
Alex Cabal
dbefba6b94 Change 'timestamp' properties on objects to more descriptive names 2022-06-29 17:19:28 -05:00
Alex Cabal
2ef5ce6551 Add poll system for Patrons Circle 2022-06-29 17:17:20 -05:00
Alex Cabal
1b237265c7 Add opensearch directives to Atom and RSS feeds 2022-06-24 13:26:15 -05:00
Alex Cabal
c109c565cb Move feeds under new /feeds root 2022-06-24 12:54:57 -05:00
Alex Cabal
dcb20692aa Add --force option to generate-feeds 2022-06-24 10:48:12 -05:00
Alex Cabal
f9fd6c8a02 Further refinment to OPDS/RSS generation and also add Atom feeds 2022-06-23 21:27:25 -05:00
Alex Cabal
afe7ebeb22 Fix broken template in payment process script 2022-06-23 09:33:46 -05:00
Alex Cabal
ae79fc1f36 Add --no-feeds argument to deploy script 2022-06-22 15:09:05 -05:00
Alex Cabal
f6df03cfca Flesh out OPDS generation backend to be more robust and to support generic Atom feeds 2022-06-22 15:09:05 -05:00
Alex Cabal
10630de2e3 Make some scripts explicitly executable 2022-06-20 14:43:53 -05:00
Alex Cabal
70a80d0e02 Add system to retrieve and manage donations in a local database 2022-06-20 14:05:27 -05:00
Alex Cabal
37830e173f Continue improving serving and display of RSS/OPDS 2022-06-20 11:31:58 -05:00
Alex Cabal
a3d823dd5a Add XSLT stylesheet for RSS feed 2022-06-19 21:11:43 -05:00
Alex Cabal
b0197d189a Add newsletter management functionality 2022-03-20 17:46:47 -05:00
Alex Cabal
1e698f2389 Anonymize web logs after rotating and disable explicit download logging in favor of grepping the regular web logs 2022-03-16 13:04:52 -04:00
David Grigg
500db52ef3 Added to allowed characters in tokens
GitHub tokens now include an underscore character
2022-01-12 08:53:31 -06:00
Alex Cabal
ac812085db Update deploy-ebook-to-www to prevent it from destroying the new releases XML file if there's an error in an ebook 2021-10-08 20:01:55 -05:00
Alex Cabal
7be2f18424 Switch to new array shorthand 2021-10-06 18:03:28 -05:00
Alex Cabal
a2f7517e08 Tweak in-book CSS and add details link to single-page book view 2021-07-27 16:04:05 -05:00
Robin Whittleton
c6a0cfcd6f Add a link back to the ebook page to nav bar 2021-07-27 15:45:14 -05:00