mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 19:28:25 +02:00
15 lines
467 B
Python
15 lines
467 B
Python
import subprocess
|
|
from . import error
|
|
|
|
WIMGT_PATH = "./tools/szs/wimgt"
|
|
|
|
|
|
@error.better_wszst_error(wszst_tools=WIMGT_PATH)
|
|
def encode(file: str, format: str) -> None:
|
|
"""
|
|
Encode an .png image into a new format
|
|
:param file: .png image
|
|
:param format: new image format
|
|
"""
|
|
subprocess.run([WIMGT_PATH, "ENCODE", file, "-x", format, "--overwrite"],
|
|
creationflags=subprocess.CREATE_NO_WINDOW, check=True, stdout=subprocess.PIPE)
|