Skip to content

Commit 86fdde6

Browse files
authored
fix head layout
1 parent a534ebf commit 86fdde6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
GitHub: https://github.com/FastChen/PHP-Minecraft-Skin
66
URL: https://fastchen.com/works/
77
Principle: https://fastchen.com/works/minecraftskin.html
8-
98
- HOT TO USE -
109
https://yousite/?name=your minecraft id (NOT UUID)
1110
&avatarsize=256 Change avatar size(default 64x64)
@@ -37,7 +36,10 @@
3736
//裁剪并缩放创建头像
3837
$copyskin = imagecreatetruecolor($size_avatar, $size_avatar);
3938
$originalskin = imagecreatefromstring(file_get_contents($de_textures['textures']['SKIN']['url']));
39+
//头部
4040
imagecopyresized($copyskin, $originalskin, 0, 0, 8, 8, $size_avatar, $size_avatar, 8, 8);
41+
//遮罩
42+
imagecopyresized($copyskin, $originalskin, 0, 0, 40, 8, $size_avatar, $size_avatar, 8, 8);
4143
//保存生成后头像
4244
//输出拷贝后图像
4345
//header("Content-type: image/jpeg");

0 commit comments

Comments
 (0)