Commit graph

168 commits

Author SHA1 Message Date
Alex Cabal
e55fecaaa2 Switch from DateTime to DateTimeImmutable across codebase 2024-04-13 14:05:14 -05:00
Alex Cabal
36adb85067 Add ingest-fa-payments script 2024-01-15 15:49:16 -06:00
Alex Cabal
4126db9c3e Remove references to unused script 2024-01-15 12:59:53 -06:00
Alex Cabal
531e3600ea Convert some constants to enums 2024-01-14 22:32:47 -06:00
Alex Cabal
5a1c05d8c5 Add password login option for some users, and further refinements to artwork management system 2024-01-06 22:27:38 -06:00
Mike Colagrosso
6a5c05511a Add cover art database
Co-authored-by: Job Curtis <job.curtis@gmail.com>
Co-authored-by: Alex Cabal <alex@standardebooks.org>
2024-01-03 19:14:04 -06:00
Alex Sweet
b2777ee648 Add check for rsvg-convert 2024-01-01 20:21:37 -06:00
Alex Cabal
637b245bcd Make chapter navigation footer script executable 2023-12-23 10:50:18 -06:00
erin
776d42b565 Reorder imports in navigation footer script 2023-12-22 21:28:53 -06:00
erin
40b3ed1340 Update variable names in navigation footer script 2023-12-22 21:28:53 -06:00
erin
c6da28f878 Remove extension from navigation footer links 2023-12-22 21:28:53 -06:00
erin
c62ab2354f Correct code style in navigation footer script 2023-12-22 21:28:53 -06:00
erin
fcda045958 Update navigation footer script in Python 2023-12-22 21:28:53 -06:00
Alex Cabal
0f324efed1 Update payment process script to work with new FA HTML 2023-09-10 21:28:17 -05:00
Alex Cabal
ed4cdcae57 Add rel="prev/next" to navigation footers in ebook text 2023-08-28 10:22:11 -05:00
Alex Cabal
031aa0f4df Tweak Patrons Circle renewal emails 2023-08-02 10:33:06 -05:00
Alex Cabal
8127f0c7e2 Remove unused exception variables, now that this is possible with PHP8 2023-06-06 21:00:12 -05:00
Alex Cabal
2dd89c310f Add unprocessed pending payments watchdog 2023-05-15 12:38:01 -05:00
Alex Cabal
1c055d3e6f Disable emulate prepares in DB 2023-05-13 23:42:58 -05:00
Alex Cabal
b58df6b141 Correctly include cover JPGs in azw3 bulk downloads 2023-04-30 02:14:09 -05:00
Alex Cabal
6ec1669308 Update payment process script to work around FA additions 2023-04-26 15:54:30 -05:00
Alex Cabal
689cd1c5c1 Tweak ebook deploy script to more reliably generate cover image thumbnails 2023-04-23 19:56:58 -05:00
Alex Cabal
03d7206f93 Add PHP 8 compatibility tweak for generating bulk downloads 2023-04-23 18:50:35 -05:00
Alex Cabal
e28e8453b9 Add Kindle thumbnails to AZW3 bulk downloads 2023-04-19 12:06:36 -05:00
Anthony J. Bentley
4bfd85ffbf Check truncated repo names properly even when they end in .git 2023-02-17 13:39:17 -06:00
Anthony J. Bentley
a64adf4b1d Improve comment 2023-02-17 13:39:17 -06:00
Anthony J. Bentley
4ef06e6443 sync-ebooks: Don't rename repository if target directory already exists 2023-02-17 13:39:17 -06:00
Anthony J. Bentley
3a231d7cee Don't escape forward slash in grep expression 2023-02-16 12:10:28 -06:00
Alex Cabal
e7ef78bcd4 Add code to mark donations as company matches for purposes of calculatin the patron's circle 2023-01-05 17:04:02 -06:00
Alex Cabal
26a24cdbe2 Pretty print SQL 2022-12-24 15:44:42 -06:00
Alex Cabal
df07b87d90 Change permissions on script 2022-12-21 22:40:23 -06:00
Alex Cabal
9f87133cb9 Notify admins of new fully-anonymous patrons 2022-12-11 12:10:27 -06:00
Alex Cabal
9204262bab Minor style tweaks 2022-11-28 14:23:12 -06:00
Brandon
88e7f63486 Revert "Fix margin collapse issue" and adjust whitespace to compensate
This reverts commit a806fc41a8.
2022-11-28 14:18:27 -06:00
Brandon
13f15e34a1 Fix margin collapse issue 2022-11-28 14:18:27 -06:00
Brandon
537e14122f Wrap book contents in a <main> tag 2022-11-28 14:18:27 -06:00
Brandon
55e7a717f3 Italicize instead of em 2022-11-28 14:18:27 -06:00
Brandon
04cf6bce03 Add chapter navigation footer 2022-11-28 14:18:27 -06:00
Alex Cabal
2eba3974b7 Update payment process script for new FA quirk 2022-11-27 22:42:32 -06:00
Alex Cabal
6b5c4d8975 Add --quiet option when calling cavif 2022-09-19 10:39:33 -05:00
Alex Cabal
ca4d86c3e7 Update cavif binary to one linked to Ubuntu 18.04 libs 2022-09-19 10:39:20 -05:00
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