25 lines
671 B
PHP
25 lines
671 B
PHP
<?php
|
|
include("connectsql.php");
|
|
include_once("functions.php");
|
|
if (isset($_GET[id]) && is_numeric($_GET[id])) {
|
|
$id = $_GET[id];
|
|
$sql = "SELECT * FROM `mt_skins` LIMIT 0 , 100";
|
|
$result = mysql_query($sql);
|
|
while($row = mysql_fetch_assoc($result)){
|
|
|
|
$id=$row[id];
|
|
$bin = base64_decode($row[img]);
|
|
$img_src = imagecreatefromstring($bin);
|
|
$size = 1;
|
|
$thumb = create2d($img_src,$size);
|
|
//header("Content-Type: image/png");
|
|
@mkdir("./skins");
|
|
@mkdir("./skins/".$size."");
|
|
imagepng($thumb,"./skins/".$size."/".$id.".png");
|
|
echo "saved ./skins/".$size."/".$id.".png<br>";
|
|
}
|
|
}
|
|
else {
|
|
echo "missing or invalid param 'id'";
|
|
}
|
|
?>
|