Merge branch 'main' into feat/device-pixel-alignment
C++ / fmt (pull_request) Failing after 6s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 7s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 26s
Rust / build (pull_request) Successful in 54s
Python / verify (pull_request) Failing after 1m29s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 50s
C++ / fmt (pull_request) Failing after 6s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 7s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 26s
Rust / build (pull_request) Successful in 54s
Python / verify (pull_request) Failing after 1m29s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 50s
This commit is contained in:
@@ -545,7 +545,7 @@ def generate(
|
|||||||
except (PermissionError, OSError, BlockingIOError):
|
except (PermissionError, OSError, BlockingIOError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def smart_mode(image_path: Path) -> str:
|
def smart_mode(image_path: Path | io.BytesIO) -> str:
|
||||||
is_dark = ""
|
is_dark = ""
|
||||||
|
|
||||||
with Image.open(image_path) as img:
|
with Image.open(image_path) as img:
|
||||||
@@ -739,7 +739,7 @@ def generate(
|
|||||||
|
|
||||||
return rendered_outputs
|
return rendered_outputs
|
||||||
|
|
||||||
def seed_from_image(image_path: Path) -> Hct:
|
def seed_from_image(image_path: Path | io.BytesIO) -> Hct:
|
||||||
image = Image.open(image_path)
|
image = Image.open(image_path)
|
||||||
pixel_len = image.width * image.height
|
pixel_len = image.width * image.height
|
||||||
image_data = image.getdata()
|
image_data = image.getdata()
|
||||||
@@ -837,11 +837,13 @@ def generate(
|
|||||||
image_path = image_path or Path(WALL_PATH)
|
image_path = image_path or Path(WALL_PATH)
|
||||||
|
|
||||||
blob = scheme_thumb_from_db(str(DB_PATH), str(image_path))
|
blob = scheme_thumb_from_db(str(DB_PATH), str(image_path))
|
||||||
if blob is not None:
|
|
||||||
open_thumb = lambda: io.BytesIO(blob)
|
def open_thumb():
|
||||||
else:
|
if blob is not None:
|
||||||
thumb_path = generate_thumbnail(image_path, THUMB_DIR)
|
return io.BytesIO(blob)
|
||||||
open_thumb = lambda: thumb_path
|
else:
|
||||||
|
thumb_path = generate_thumbnail(image_path, THUMB_DIR)
|
||||||
|
return thumb_path
|
||||||
|
|
||||||
seed = seed_from_image(open_thumb())
|
seed = seed_from_image(open_thumb())
|
||||||
name = "dynamic"
|
name = "dynamic"
|
||||||
|
|||||||
Reference in New Issue
Block a user