mirror of
https://github.com/rottenwheel/revuo-weekly.git
synced 2024-10-01 04:35:37 -04:00
feat: compress cover image
This commit is contained in:
parent
063f4610ec
commit
220673484a
@ -6,7 +6,7 @@ import argparse
|
|||||||
import datetime
|
import datetime
|
||||||
import tempfile
|
import tempfile
|
||||||
import tomllib
|
import tomllib
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
def get_period_string(
|
def get_period_string(
|
||||||
start: datetime.datetime,
|
start: datetime.datetime,
|
||||||
@ -124,6 +124,9 @@ def create_issue_image(
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
image = Image.open(f"content/weekly/issue-{issue_number}/cover.png")
|
||||||
|
image = image.convert("RGB").quantize(colors=256)
|
||||||
|
image.save(f"content/weekly/issue-{issue_number}/cover.png", "PNG", compress_level=9)
|
||||||
|
|
||||||
def get_latest_issue() -> int:
|
def get_latest_issue() -> int:
|
||||||
"""Get the latest issue number from the weekly directory
|
"""Get the latest issue number from the weekly directory
|
||||||
|
Loading…
Reference in New Issue
Block a user