1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-11 20:58:19 +08:00

Fix: [EN] POPUP assets now in 1280x720

- Add assets check to button_extract
This commit is contained in:
LmeSzinc
2020-06-12 00:02:54 +08:00
parent 49ae4c6361
commit c37fda242c
4 changed files with 11 additions and 2 deletions

View File

@@ -43,6 +43,8 @@ class ImageExtractor:
@staticmethod
def extract(file):
image = Image.open(file).convert('RGB')
if image.size != (1280, 720):
logger.warning(f'Incorrect asset {image.size} {file}')
bbox = image.getbbox()
mean = get_color(image=image, area=bbox)
mean = tuple(np.rint(mean).astype(int))
@@ -87,6 +89,13 @@ class TemplateExtractor(ImageExtractor):
# self.module = module
# self.file = file
# self.config = config
@staticmethod
def extract(file):
image = Image.open(file).convert('RGB')
bbox = image.getbbox()
mean = get_color(image=image, area=bbox)
mean = tuple(np.rint(mean).astype(int))
return bbox, mean
@property
def expression(self):