исправление бага с картинкой
This commit is contained in:
@@ -38,6 +38,21 @@ def main():
|
||||
assert by_name["thumbnail"]["sha256"] != {
|
||||
item["name"]: item for item in newer
|
||||
}["thumbnail"]["sha256"]
|
||||
|
||||
odd_ratio = io.BytesIO()
|
||||
Image.new("RGB", (319, 200), "blue").save(odd_ratio, format="PNG")
|
||||
odd_variants = {
|
||||
item["name"]: item for item in build_variants(attachment_id, odd_ratio.getvalue())
|
||||
}
|
||||
assert (odd_variants["thumbnail"]["width"], odd_variants["thumbnail"]["height"]) == (256, 160)
|
||||
|
||||
small_image = io.BytesIO()
|
||||
Image.new("RGB", (100, 50), "red").save(small_image, format="PNG")
|
||||
small_variants = {
|
||||
item["name"]: item for item in build_variants(attachment_id, small_image.getvalue())
|
||||
}
|
||||
assert (small_variants["thumbnail"]["width"], small_variants["thumbnail"]["height"]) == (100, 50)
|
||||
assert (small_variants["optimized"]["width"], small_variants["optimized"]["height"]) == (100, 50)
|
||||
print("PASS: versioned thumbnail, crop, and optimized variants match dimensions and checksums")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user