Compare commits

...

2 Commits

2 changed files with 3 additions and 2 deletions

View File

@ -65,7 +65,8 @@ function create_thumbnail(string $category, string $file): string | null {
$path = add_seperator_ab("/", $category, $file);
$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_name = "$hash.jpg";

View File

@ -23,7 +23,7 @@ def main():
exit(1)
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)
image = image.resize((target_width, new_height), Image.Resampling.BICUBIC)