Commit 2553a234 by sikang

update script

parent d2e2c075
......@@ -381,6 +381,20 @@ class Function:
}
self.update_properties(config, lines)
def crop_logo(self,config):
img_avg = Image.open(logo_path)
logo_h = img_avg.size[1] * (512/img_avg.size[0])
top_h = img_avg.size[1] * (1024/img_avg.size[0])
img_logo = img_avg.resize((512, int(logo_h)),Image.ANTIALIAS)
img_top = img_avg.resize((1024, int(top_h)),Image.ANTIALIAS)
# 裁切图片
img_logo = img_logo.crop((0, (logo_h - 512)/2, img_logo.size[0], 512 + (logo_h - 512)/2))
img_top = img_top.crop((0, (top_h - 500)/2, img_top.size[0], 500+(top_h - 500)/2))
img_logo.save("%s/app/src/main/res/drawable-xxhdpi/logo_majia.png"% config['root'],"PNG")
img_top.save("%s/app/src/main/res/drawable-xxhdpi/top.png"% config['root'],"PNG")
#copy logo
def find_logo(self,config):
path = "/Users/connor/Downloads/%s"%config['corp_id']
......
......@@ -180,7 +180,7 @@ elif command == 121:
Shell().install_app(config)
elif command == 122:
Shell().install_app(config)
Function().crop_logo(config)
elif command == 123:
Function().find_logo(config)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment