mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-05 03:24:41 +00:00
uwuzu version 1.2.27
This commit is contained in:
@@ -15,6 +15,7 @@ function createUniqId(){
|
||||
}
|
||||
|
||||
require('db.php');
|
||||
$servericonfile = "server/servericon.txt";
|
||||
|
||||
$servernamefile = "server/servername.txt";
|
||||
|
||||
@@ -99,6 +100,40 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset
|
||||
}
|
||||
}
|
||||
|
||||
function rotate($image, $exif)
|
||||
{
|
||||
$orientation = $exif['Orientation'] ?? 1;
|
||||
|
||||
switch ($orientation) {
|
||||
case 1: //no rotate
|
||||
break;
|
||||
case 2: //FLIP_HORIZONTAL
|
||||
imageflip($image, IMG_FLIP_HORIZONTAL);
|
||||
break;
|
||||
case 3: //ROTATE 180
|
||||
$image = imagerotate($image, 180, 0);
|
||||
break;
|
||||
case 4: //FLIP_VERTICAL
|
||||
imageflip($image, IMG_FLIP_VERTICAL);
|
||||
break;
|
||||
case 5: //ROTATE 270 FLIP_HORIZONTAL
|
||||
$image = imagerotate($image, 270, 0);
|
||||
imageflip($image, IMG_FLIP_HORIZONTAL);
|
||||
break;
|
||||
case 6: //ROTATE 90
|
||||
$image = imagerotate($image, 270, 0);
|
||||
break;
|
||||
case 7: //ROTATE 90 FLIP_HORIZONTAL
|
||||
$image = imagerotate($image, 90, 0);
|
||||
imageflip($image, IMG_FLIP_HORIZONTAL);
|
||||
break;
|
||||
case 8: //ROTATE 270
|
||||
$image = imagerotate($image, 90, 0);
|
||||
break;
|
||||
}
|
||||
return $image;
|
||||
}
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
|
||||
@@ -170,6 +205,19 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
// ファイルを移動
|
||||
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
|
||||
|
||||
// EXIF削除
|
||||
if($extension == "jpg" || $extension == "jpeg"){
|
||||
$gd = imagecreatefromjpeg($uploadedPath);
|
||||
$w = imagesx($gd);
|
||||
$h = imagesy($gd);
|
||||
$gd_out = imagecreatetruecolor($w,$h);
|
||||
imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
|
||||
$exif = exif_read_data($uploadedPath);
|
||||
$gd_out = rotate($gd_out, $exif);
|
||||
imagejpeg($gd_out, $uploadedPath);
|
||||
imagedestroy($gd_out);
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||
} else {
|
||||
@@ -467,9 +515,18 @@ $pdo = null;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<head prefix="og:http://ogp.me/ns#">
|
||||
<meta charset="utf-8">
|
||||
<!--OGPはじまり-->
|
||||
<meta property="og:title" content="アカウント登録 - <?php echo file_get_contents($servernamefile);?>">
|
||||
<meta property="og:description" content="<?php echo file_get_contents($servernamefile);?>にアカウント登録">
|
||||
<meta property="og:url" content="https://<?php echo htmlentities($domain, ENT_QUOTES, 'UTF-8'); ?>/new">
|
||||
<meta property="og:image" content="<?php echo htmlspecialchars(file_get_contents($servericonfile), ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content="アカウント登録 - <?php echo file_get_contents($servernamefile);?>">
|
||||
<!--OGPここまで-->
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<script src="js/unsupported.js"></script>
|
||||
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="favicon/icon-192x192.png">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
Reference in New Issue
Block a user