diff --git a/app/Http/Controllers/SkinlibController.php b/app/Http/Controllers/SkinlibController.php index 98dc5bb3..8991dcff 100644 --- a/app/Http/Controllers/SkinlibController.php +++ b/app/Http/Controllers/SkinlibController.php @@ -276,6 +276,8 @@ class SkinlibController extends Controller if ($type == "steve" || $type == "alex") { if ($ratio != 2 && $ratio != 1) return json(trans('skinlib.upload.invalid-size', ['type' => trans('general.skin'), 'width' => $size[0], 'height' => $size[1]]), 1); + if ($size[0] % 64 != 0 || $size[1] % 32 != 0) + return json(trans('skinlib.upload.invalid-hd-skin', ['type' => trans('general.skin'), 'width' => $size[0], 'height' => $size[1]]), 1); } elseif ($type == "cape") { if ($ratio != 2) return json(trans('skinlib.upload.invalid-size', ['type' => trans('general.cape'), 'width' => $size[0], 'height' => $size[1]]), 1); diff --git a/resources/lang/en/skinlib.yml b/resources/lang/en/skinlib.yml index 4fb18760..656d05ad 100644 --- a/resources/lang/en/skinlib.yml +++ b/resources/lang/en/skinlib.yml @@ -74,6 +74,7 @@ upload: type-error: Incorrect mime type of uploaded file. invalid-size: Invalid :type file (Width :width, Height :height) + invalid-hd-skin: Invalid HD skin (Width and height can not be devided by 32) lack-score: You don't have enough score to upload this texture. repeated: The texture is already uploaded by someone else. You can add it to your closet directly. diff --git a/resources/lang/zh_CN/skinlib.yml b/resources/lang/zh_CN/skinlib.yml index 35122300..3b158f3d 100644 --- a/resources/lang/zh_CN/skinlib.yml +++ b/resources/lang/zh_CN/skinlib.yml @@ -73,6 +73,7 @@ upload: type-error: 文件格式不对哦 invalid-size: 不是有效的 :type 文件(宽 :width,高 :height) + invalid-hd-skin: 不是有效的高清皮肤(宽和高不是 32 的整数倍) lack-score: 积分不够啦 repeated: 已经有人上传过这个材质了,直接添加到衣柜使用吧~