Created
November 18, 2014 02:24
-
-
Save aiwas/5a7ea9c205e176868a1a to your computer and use it in GitHub Desktop.
Minecraftのスキンの顔部分を取得する奴 4.xでもうごく
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user = $_GET['user']; | |
$url = "http://s3.amazonaws.com/MinecraftSkins/{$user}.png"; | |
$skin = imagecreatefrompng($url); | |
$face = imagecreatetruecolor(8, 8); | |
imagecopy($face, $skin, 0, 0, 8, 8, 8, 8); | |
header('Content-Type: image/png'); | |
imagepng($face); | |
imagedestroy($face); | |
imagedestroy($skin); |
・HTMLだけで補間指定の拡大縮小が出来ないので、imagecopyresampled()で160*160くらいに拡大しておいたほうがいいかもしれない
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
・GD Libraryがいります
・allow_url_fopenはtrueで