Compare commits
2 Commits
c5b4dda950
...
982565bd95
Author | SHA1 | Date | |
---|---|---|---|
982565bd95 | |||
11c3faddb0 |
@ -65,7 +65,8 @@ function create_thumbnail(string $category, string $file): string | null {
|
|||||||
|
|
||||||
$path = add_seperator_ab("/", $category, $file);
|
$path = add_seperator_ab("/", $category, $file);
|
||||||
$original_file = ROOT_DIR.IMG_DIR.$path;
|
$original_file = ROOT_DIR.IMG_DIR.$path;
|
||||||
$hash = hash_file("sha1", $original_file);
|
# use fast hashing algo, see: https://github.com/Cyan4973/xxHash
|
||||||
|
$hash = hash_file("xxh3", $original_file);
|
||||||
|
|
||||||
$thumbnail_directory = ROOT_DIR.THUMBNAIL_DIR;
|
$thumbnail_directory = ROOT_DIR.THUMBNAIL_DIR;
|
||||||
$thumbnail_name = "$hash.jpg";
|
$thumbnail_name = "$hash.jpg";
|
||||||
|
@ -23,7 +23,7 @@ def main():
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
width, height = image.size
|
width, height = image.size
|
||||||
target_width = int(max(width/4, 1280))
|
target_width = int(max(width/2, 1280))
|
||||||
new_height = int(target_width * height / width)
|
new_height = int(target_width * height / width)
|
||||||
|
|
||||||
image = image.resize((target_width, new_height), Image.Resampling.BICUBIC)
|
image = image.resize((target_width, new_height), Image.Resampling.BICUBIC)
|
||||||
|
Loading…
Reference in New Issue
Block a user