phpimageeditor を個人使用のために修正しました

WBOY
リリース: 2016-08-08 09:27:33
オリジナル
1010 人が閲覧しました

ダウンロード组件phpimageeditor;
$ vim phpimageeditor/lite/shared/classes/phpimageeditor.php
被盖
class PHPImageEditor {
var $srcEdit = "";
var $name = "";
var $srcOriginal = " ";
var $srcPng = "";
var $srcWorkWith = "";
var $urlWorkWith = "";
var $resourceWorkWith = false;
var $mimeType = "";
var $actionSaveAndClose = "保存";
var $actionRotateLeft = "rotate:90";
var $actionRotateRight = "rotate:-90";
var $actionGrayscale = "グレースケール";
var $actionContrast = "コントラスト";
var $actionBrightness = "明るさ"; bar $ ActionUndo = "undo"; ;
var $errorMessages = array();
var $formName = "phpimageeditor";
var $inputWidth = -1;
var $inputHeight = -1;
var $inputCropLeft = 0;
var $inputCropRight = 0;
var $inputCropTop = 0;
var $inputCropBottom = 0;
var $inputKeepProportions = true;
var $inputCropKeepProportions = false;
var $inputCropKeepProportionsRatio = 1;
var $inputPanel = PANEL;
var $inputLanguage = PIE_DEFAULT_LANGUAGE;
var $ inputContrast = 0;
var $ inputbrightness = 0; ;
var $actions = "";
var $isPostBack = false;
var $isAjaxPost = false;
var $finalWidth = -1;
var $finalHeight = -1;
var $widthKeepProportions = -1;
var $ heightKeepProportions = -1;
var $userId = "";
var $fonts = array();
var $doSave = false;
var $contrastMax = 100;
var $brightnessMax = 255;
// var $photoInfo = array();

function PHPImageEditor() {
$this->LoadLanguage();
if (version_compare(phpversion(), PIE_PHP_VERSION_MINIMUM, " $this->errorMessages[] = 。 「」。 $this->texts["古い PHP バージョン"] 。 「」。 PIE_PHP_VERSION_MINIMUM;
return;
}
$this->isPostBack = isset($_POST["actiontype"]);
$srcEdit = "";
if ($_GET[$this->httpImageKey] ! = NULL) {
$l = DIRECTORY_SEPARATOR;
$file = dirname(dirname(dirname(dirname(__FILE__)))) 。 "{$l}tmp{$l}{$_GET[$this->httpImageKey]}";
#$srcEdit =strip_tags($_GET[$this->httpImageKey]);
$srcEdit =strip_tags($file) ;
} if ($srcEdit == "") {
$this->errorMessages[] = $this->texts["提供された画像はありません"];
return;
}
}
$this->srcEdit = urldecode( $srcEdit);
if (isset($_POST["userid"]))
$this->userId = $_POST["userid"];
else {
            $this->userId = "_" 。 str_replace(".", "_", $_SERVER['REMOTE_ADDR']);
#Windows Vista の仮想ボックスでは、:: を ip として取得します。
#エラーを避けるために削除してください。
$this-> userId = str_replace("_::", "", $this->userId);
}
$this->SetSrcOriginal();
$this->SetSrcPng();
$this->SetSrcWorkWith();
if (!file_exists($this->srcEdit)) {
$this->errorMessages[] = $this->texts["イメージが存在しません"];
return;
}
$info = getimagesize($this- >srcEdit);
if (!$info) {
$this->errorMessages[] = $this->texts["無効な画像タイプ"];
return;
}
$this->mimeType = mime_type($info [2]);
// echo image_type_to_mime_type($info[2])."===".image_type_to_mime_type(IMAGETYPE_JPEG);exit;
if ($this->mimeType == image_type_to_mime_type(IMAGETYPE_JPEG) || $this- >mimeType == image_type_to_mime_type(IMAGETYPE_GIF) || $this->mimeType == image_type_to_mime_type(IMAGETYPE_PNG)) {
if (!$this->isPostBack)
$this->SaveOriginal();
$this->resourceWorkWith = $ this->CreateImage($this->srcOriginal);
$this->SavePng();
copy($this->srcPng, $this->srcWorkWith);
$this->resourceWorkWith = $this->CreateImage( $this->srcPng);
}
else {
$this->errorMessages[] = $this->texts["無効な画像タイプ"];
return;
}
$this ->finalWidth = $this-> GetWidth();
$this->finalHeight = $this->GetHeight();
$this->widthKeepProportions = $this->GetWidth();
$this->heightKeepProportions = $this->GetHeight();
// $this->photoInfo = $this->GetUserData();
if ($this->isPostBack) {
$this->actionRotateIsSelected = (strip_tags($_POST["rotate"]) != "-1" );
$this->actionRotate =trip_tags($_POST["rotate"]);
$this->actions =trip_tags($_POST["actions"]);
$this->isAjaxPost = (strip_tags($_POST ["isajaxpost"]) == "true");
$this->inputWidth = (int)strip_tags($_POST["width"]);
$this->inputHeight = (int)strip_tags($_POST[" height"]);
$this->inputCropLeft = (int)strip_tags($_POST["cropleft"]);
$this->inputCropRight = (int)strip_tags($_POST["cropright"]);
$this ->inputCropTop = (int)strip_tags($_POST["croptop"]);
$this->inputCropBottom = (int)trip_tags($_POST["cropbottom"]);
$this->inputPanel = (int)strip_tags ($_POST["パネル"]);
            $this->inputLanguage = ストリップ_tags($_POST["言語"]);
$this->inputKeepProportions = (strip_tags($_POST["keepproportionsval"]) == "1");
$this->inputCropKeepProportions = ( trip_tags($_POST["cropkeepproportionsval"]) == "1");
$this->inputCropKeepProportionsRatio = (float)strip_tags($_POST["cropkeepproportionsratio"]);
$this->inputGrayscale = (strip_tags _POST ["grayscaleval"]) == "1");
$this->inputBrightness = (int)strip_tags($_POST["brightness"]);
$this->inputContrast = (int)strip_tags($_POST["コントラスト"]);
$this->inputBrightnessLast = (int)strip_tags($_POST["brightnesslast"]);
$this->inputContrastLast = (int)strip_tags($_POST["contrastlast"]);
$this ->Action(strip_tags($_POST["actiontype"]));
}
}
function LoadLanguage() {
$ language = "";
if (isset($_POST[" language"])) {
$ this->inputLanguage = $_POST[" language"];
$ language = $this->inputLanguage;
} else if (isset($_GET[" language"])) {
$this->inputLanguage = $_GET[ "言語"];
$ language = $this->inputLanguage;
} else
$ language = PIE_DEFAULT_LANGUAGE;
$tryLanguage = "言語/" 。 $言語 。 ".ini";
if (file_exists($tryLanguage))
$this->texts = PIE_GetTexts(" language/" . $ language . ".ini");
else
$this->texts = PIE_GetTexts(" language /" . PIE_DEFAULT_LANGUAGE . ".ini");
//現在の言語に存在しないテキストを english からロードします。
$texts = PIE_GetTexts(" language/en-GB.ini");
foreach ($texts as $key => $text) {
if (array_key_exists($key, $this->texts) === false)
$this->texts[$key] = $text;
}
}
function SetSrcOriginal() {
$arr =explode("/", $this->srcEdit);
$this->srcOriginal = PIE_IMAGE_ORIGINAL_PATH 。 $this->AddUserIdToImageSrc($arr[count($arr) - 1]);
}
function SetSrcWorkWith() {
$arr =explode("/", $this->srcEdit);
$srcWorkWith = PIE_IMAGE_WORK_WITH_PATH 。 $this->AddUserIdToImageSrc($arr[count($arr) - 1]);
$srcWorkWith = substr($srcWorkWith, 0, strripos($srcWorkWith, ".")) 。 ".png";
$this->srcWorkWith = $srcWorkWith;
// $this->urlWorkWith = $this->isAjaxPost && $_POST['actiontype'] == $this->actionSaveAndClose
// ? ? "http://".str_replace(DIRECTORY_SEPARATOR,"/",str_replace(DOC_ROOT,$_SERVER['SERVER_NAME'],$this->srcEdit))
// : "http://".str_replace(DIRECTORY_SEPARATOR," /",str_replace(DOC_ROOT,$_SERVER['SERVER_NAME'],$srcWorkWith))
        // ;
if ($_POST['actiontype'] == $this->actionSaveAndClose) {
$this->urlWorkWith = "http://" 。 str_replace(DIRECTORY_SEPARATOR, "/", str_replace(DOC_ROOT, $_SERVER['SERVER_NAME'], $this->srcEdit));
# echo "Ajax:{$this->urlWorkWith}";
} else {
$this ->urlWorkWith = "http://" 。 str_replace(DIRECTORY_SEPARATOR, "/", str_replace(DOC_ROOT, $_SERVER['SERVER_NAME'], $srcWorkWith));
# echo "noAjax:{$this->urlWorkWith}";
}
}
関数 SetSrcPng() {
$arr =explode("/", $this->srcEdit);
$srcPng = PIE_IMAGE_PNG_PATH 。 $this->AddUserIdToImageSrc($arr[count($arr) - 1]);
$srcPng = substr($srcPng, 0, strripos($srcPng, ".")) 。 ".png";
$this->srcPng = $srcPng;
}
function SaveOriginal() {
copy($this->srcEdit, $this->srcOriginal);
#最大幅/高さに収まるようにサイズを変更します。
$imageTmp = $this->CreateImage($this->srcOriginal);
$finalWidth = $this->GetWidthFromImage($imageTmp);
$finalHeight = $this->GetHeightFromImage($imageTmp);
$doSave = false ;
if ($finalWidth > PIE_IMAGE_MAX_WIDTH) {
$widthProp = PIE_IMAGE_MAX_WIDTH / $finalWidth;
$finalWidth = PIE_IMAGE_MAX_WIDTH;
$finalHeight = * $widthProp);
$doSave = true;
}
if ($ FinalHeight > PIE_IMAGE_MAX_HEIGHT) {
$heightProp = PIE_IMAGE_MAX_HEIGHT / $finalHeight;
$finalHeight = PIE_IMAGE_MAX_HEIGHT;
$finalWidth =round($finalWidth * $heightProp);
$doSave = true;
}
if ($doSave) {
$ imageTmp = $this->ActionResize($finalWidth, $finalHeight, $imageTmp);
$this->SaveImage($imageTmp, $this->srcOriginal);
}
}
function SavePng() {
$this-> SaveImage($this->resourceWorkWith, $this->srcPng, image_type_to_mime_type(IMAGETYPE_PNG));
}
function ErrorHasOccurred() {
return (count($this->errorMessages) > 0);
}
function GetWidthFinal() {
return $this->finalWidth;
}
function GetHeightFinal() {
return $this->finalHeight;
}
function GetWidth() {
return $this->GetWidthFromImage($this->resourceWorkWith);
}
function GetWidthLast() {
if ($this->isPostBack)
return (int) $_POST["widthlast"];
return $this->GetWidth();
}
    function GetHeight() {
return $this->GetHeightFromImage($this->resourceWorkWith);
}
function GetHeightLast() {
if ($this->isPostBack)
return (int) $_POST["heightlast"];
return $this->GetWidth();
}
function GetWidthFromImage($image) {
return imagex($image);
}
function GetHeightFromImage($image) {
return imagey($image);
}
関数action($ actionType){
$ this-> dosave = false; if ($actionType == $this->actionUpdate || $actionType == $this->actionSaveAndClose) {
if ($this->inputWidth != $this->GetWidthLast() || $this->inputHeight != $this->GetHeightLast())
$this->actions .= $this->GetActionSeparator() 。 "サイズ変更:" 。 $this->inputWidth 。 「、」。 $this->inputHeight;
if ($this->inputCropLeft != 0 || $this->inputCropRight != 0 || $this->inputCropTop != 0 || $this->inputCropBottom != 0)
$ this->actions .= $this->GetActionSeparator() 。 "作物:" 。 $this->inputCropLeft 。 「、」。 $this->inputCropRight 。 「、」。 $this->inputCropTop 。 「、」。 $this->inputCropBottom;
$this->doSave = true;
}
if ($actionType == $this->actionUpdate && $this->inputGrayscale) {
if (strpos($this->actions, $this ->actionGrayscale) === false) {
$this->actions .= $this->GetActionSeparator() 。 $this->actionGrayscale 。 ":0";
$this->doSave = true;
}
} else if ($actionType == $this->actionUpdate && !$this->inputGrayscale) {
if (!(strpos($this->アクション、$this->actionGrayscale) === false)) {
$this->actions = str_replace($this->actionGrayscale . ":0" . $this->GetActionSeparator(), "", $this->アクション);
$this->actions = str_replace($this->GetActionSeparator() . $this->actionGrayscale . ":0", "", $this->actions);
$this->actions = str_replace( $this->actionGrayscale . ":0", "", $this->actions);
$this->doSave = true;
}
}
if ($this->inputContrast != $this->inputContrastLast) {
$this->actions .= $this->GetActionSeparator() 。 $this->actionContrast 。 「:」。 $ this-> inputContrast;
$ this-> dosave = true;
}
if($ this-> inputbrightness!= $ this-> inputbrightnesslast){
$ this-> action。= $ this-> getActionSeparator()。 $this->actionBrightness 。 「:」。 $this->inputBrightness;
$this->doSave = true;
}
        if ($this->actionRotateIsSelected) {
if ($this->actionRotate == $this->actionRotateLeft) {
$this->actions .= $this->GetActionSeparator() 。 $this->actionRotateLeft;
$this->doSave = true;
} else if ($this->actionRotate == $this->actionRotateRight) {
$this->actions .= $this->GetActionSeparator() 。 $this->actionRotateRight;
$this->doSave = true;
}
}
$finalContrast = 0;
$finalBrightness = 0;
$final ContrastFound = false;
$finalBrightnessFound = false;
$finalGrayscale = false;
if ($this->doSave && $this->actions != "") {
$allActions =explode($this->actionSeparatorSign, $this->actions);
$finalRotate = 0;
$finalCropLeft = 0;
$finalCropRight = 0;
$finalCropTop = 0;
$finalCropBottom = 0;
$doSwitch = false;
foreach ($allActions は $lo opAction) {
$actionDetail =explode(":", $loopAction);
$ actionValues =explode(",", $actionDetail[1]);
if ($actionDetail[0] == "resize") {
$this->finalWidth = (int) $actionValues[0];
$this- >finalHeight = (int) $actionValues[1];
} else if ($actionDetail[0] == "切り抜き") {
$actionValueLeft = (int) $actionValues[0];
$actionValueRight = (整数) $ actionValues[1];
$actionValueTop = (int) $actionValues[2];
$actionValueBottom = (int) $actionValues[3];
$widthProp = 1;
$heightProp = 1;
if ($doSwitch) {
$widthProp = (($this->GetHeight() - ($finalCropTop + $finalCropBottom)) / $this->finalWidth);
$heightProp = (($this->GetWidth() - ($finalCropLeft + $finalCr)右へ)) / $this->finalHeight);
} else {
                        $widthProp = (($this->GetWidth() - ($finalCropLeft + $finalCropRight)) / $this->finalWidth);
$heightProp = (($this->GetHeight() - ($finalCropTop + $finalCropBottom) ) / $this->finalHeight);
}
$cropLeft = $actionValueLeft * $widthProp;
$cropRight = $actionValueRight * $widthProp;
$cropTop = $actionValueTop * $heightProp;
$cropBottom = $actionValueBottom * $heightProp ;
$cropValues = array();
$cropRight;
$cropValues[] = $cropBottom;
$cropValues[] = $cropLeft;
$cropValues[] = $cropTop;
if ($finalRotate != 0)
$cropValues = $this->RotateArray(($finalRotate / -90), $cropValues);
$finalCropRight += $cropValues[0];
$finalCropBottom += $cropValues[1];
$ FinalCropLeft += $cropValues[2];
$finalCropTop += $cropValues[3];
$this->finalWidth -= ($actionValueLeft + $actionValueRight);
$this->finalHeight -= ($actionValueTop + $actionValueBottom );
}
else if ($actionDetail[0] == $this->actionGrayscale && $this->inputGrayscale) {
$finalGrayscale = true;
} else if ($actionDetail[0] == "コントラスト") {
$finalContrastFound = true;
$finalContrast = $actionValues[0];
} else if ($actionDetail[0] == "明るさ") {
$finalBrightnessFound = true;
$finalBrightness = $actionValues[0];
} else if ($actionDetail[0] == "回転") {
$finalRotate += (int) $actionValues[0];
                    $finalWidthTmp = $this->finalWidth;
$this->finalWidth = $this->finalHeight;
$this->finalWidthTmp;
}
if ($finalRotate == -360 || $finalRotate == 360 )
$finalRotate = 0;
$doSwitch = ($finalRotate != 0 && ($finalRotate == 90 || $finalRotate == 270 || $finalRotate == -90 || $finalRotate == -270));
}
//1。すべての効果。
if ($finalGrayscale)
$this->ActionGrayscale();
if ($finalBrightnessFound)
$this->ActionBrightness($finalBrightness);
if ($finalContrastFound)
$this->ActionContrast($finalContrast * -1);
//2.トリミングを行います。
$finalCropLeft =round($finalCropLeft);
$finalCropRight =round($finalCropRight);
$finalCropTop =round($finalCropTop);
$finalCropBottom( $finalCropBottom);
if ($finalCropLeft != 0 || $finalCropRight != 0 || $finalCropTop != 0 || $finalCropBottom != 0)
$this->ActionCrop($finalCropLeft, $finalCropTop, $finalCropBottom);
//3 Rotate
if ($finalRotate != 0)
$this->ActionRotate($finalRotate);
// 比率維持の値を計算します。
if (round($this->finalWidth / $this->final)高さ、1) == Round($this->GetWidth() / $this->GetHeight(), 1)) {
// オリジナルと同じ比率のようです。元の比率の値を使用します。
$this->widthKeepProportions = $this->GetWidth();
$this->heightKeepProportions = $this->GetHeight();
} else {
//比率が変更されました。代わりに新しい幅と高さを使用してください。
$this->widthKeepProportions = $this->finalWidth;
$this->heightKeepProportions = $this->finalHeight;
}
//4.サイズ変更
if ($this->finalWidth > 0 && $this->finalHeight > 0)
$this->resourceWorkWith = $this->ActionResize($this->finalWidth, $this->finalHeight, $this->resourceWorkWith );
            $this->SaveImage($this->resourceWorkWith, $this->srcWorkWith, image_type_to_mime_type(IMAGETYPE_PNG));
}
$this->inputBrightness = $finalBrightness;
$this->inputContrast = $finalContrast;
$this- >inputGrayscale = $finalGrayscale;
if ($actionType == $this->actionSaveAndClose) {
$this->SaveImage($this->resourceWorkWith, $this->srcEdit, $this->mimeType);
unlink($ this->srcOriginal);
unlink($this->srcPng);
unlink($this->srcWorkWith);
PIE_DeleteOldImages(PIE_IMAGE_ORIGINAL_PATH);
PIE_DeleteO ldImages(PIE_IMAGE_PNG_PATH);
PIE_DeleteOldImages(PIE_IMAGE_WORK_WITH_PATH);
$reloadParentBrowser = PIE_RELOAD_PARENT_BROWSER_ON_SAVE ? 'window.opener.location.reload();' : '';
// PIE_Echo('');
}
}
function ActionResize($width, $height, $image) {
$newImage = @imagecreatetruecolor($width, $height);
PIE_KeepTranspacecyCopyReサンプリング($ newImage, $this->mimeType);
imagecopyresampled($newImage, $image, 0, 0, 0, 0, $width, $height, $this->GetWidthFromImage($image), $this->GetHeightFromImage($image) ));
return $newImage;
}
function ActionCrop($cropLeft, $cropRight, $cropTop, $cropBottom) {
$cropWidth = $this->GetWidth() - $cropLeft - $cropRight;
$cropHeight = $ this->GetHeight() - $cropTop - $cropBottom;
$newImageCropped = @imagecreatetruecolor($cropWidth, $cropHeight);
PIE_KeepTranspacecyCopyResampled($newImageCropped, $this->mimeType);
//imagecopy($newImageCropped) 、$this ->resourceWorkWith、0、0、$cropLeft、$cropTop、$cropWidth、$cropHeight);
imagecopyresampled($newImageCropped, $this->resourceWorkWith, 0, 0, $cropLeft, $cropTop, $cropWidth, $cropHeight, $cropWidth, $cropHeight);
$this->resourceWorkWith = $newImageCropped;
}
関数 ActionUndo () {
$separatorPos = strrpos($this->actions, $this->actionSeparatorSign);
if (!($separatorPos === false)) {
$this->actions = substr($this->actions , 0, $separatorPos);
} else {
$this->actions = "";
}
}
function CreateImage($srcEdit) {
$info = getimagesize($srcEdit);
if (!$info)
return NULL;
$mimeType = image_type_to_mime_type($info[2]);
if ($mimeType == image_type_to_mime_type(IMAGETYPE_JPEG)) {
return imagecreatefromjpeg($srcEdit);
} else if ($mimeType == image_type_to_mime_type(IMAGETYPE_GIF) )) {
return imagecreatefromgif($srcEdit);
} else if ($mimeType == image_type_to_mime_type(IMAGETYPE_PNG)) {
return imagecreatefrompng($srcEdit);
}
NULL を返す;
    }
function ActionRotate($Degrees) {
if (function_exists('imagerotate'))
$this->resourceWorkWith = imagerotate($this->resourceWorkWith, $Degrees, 0);
else
$this-> resourceWorkWith = PIE_ImageRotate ($this->resourceWorkWith, $Degrees);
if ($this->mimeType == image_type_to_mime_type(IMAGETYPE_GIF) || $this->mimeType == image_type_to_mime_type(IMAGETYPE_PNG)) {
//透明性を保つ
imagealphablending($this ->resourceWorkWith, true);
imageavealpha($this->resourceWorkWith, true);
}
}
function ActionGrayscale() {
if (function_exists('imagefilter'))
imagefilter( $this->resourceWorkWith、IMG_FILTER_GRAYSCALE) ;
else
PIE_Grayscale($this->resourceWorkWith);
}
function ActionContrast($contrast) {
//-100 = 最大コントラスト、0 = 変化なし、+100 = 最小コントラスト
if (function_存在します('イメージフィルター' ))
imagefilter($this->resourceWorkWith, IMG_FILTER_CONTRAST, $contrast);
else
PIE_Contrast($this->resourceWorkWith, $contrast);
}
function ActionBrightness($light) {
//-255 = 最小輝度、0 = 変化なし、+255 = 最大輝度
if (function_exists('imagefilter'))
imagefilter($this->resourceWorkWith, IMG_FILTER_BRIGHTNESS, $light);
else
PIE_Brightness($this->reソースWorkWith、$light) ;
}
function GetErrorMessages() {
if (count($this->errorMessages)) {
PIE_Echo('

');
PIE_Echo('
    ');
    foreach ($this->errorMessages as $errorMessage)
    PIE_Echo('
  • ' . $errorMessage 。 '
  • ');
    PIE_Echo("
");
PIE_Echo('
');
}
}
関数 GetActions() {
PIE_Echo($this->actions);
}
関数 GetActionSeparator() {
if ($this->actions != "")
$this-> を返すActionSeSeParatorSign;
return "";
}
関数saveimage($ image、$ tosrc、$ mimetype = -1){
if($ mimeType == -1)
$ mimeType = $ this-> mimeType; mimeType == image_type_to_mime_type(IMAGETYPE_JPEG)) {
imagejpeg($image, $toSrc);
} else if ($mimeType == image_type_to_mime_type(IMAGETYPE_GIF)) {
imagegif($image, $toSrc);
} else if ($ mimeType == image_type_to_mime_type(IMAGETYPE_PNG)) {
//透明性を維持します
imageavealpha($image, true);
imagepng($image, $toSrc);
}
}
function CleanUp() {
if ($this- >resourceWorkWith)
imagedestroy($this->resourceWorkWith);
}
function RotateArray($numberOfSteps, $arr) {
$finalArray = array();
//-3 から 3
$finalAr ray[] = $arr[ $this->NumberOfStepsCalculator($numberOfSteps + 0)];
$finalArray[] = $arr[$this->NumberOfStepsCalculator($numberOfSteps + 1)];
$finalArray[] = $arr[$this->NumberOfStepsCalculator( $numberOfSteps + 2)];
$finalArray[] = $arr[$this->NumberOfStepsCalculator($numberOfSteps + 3)];
return $finalArray;
}
function NumberOfStepsCalculator($sum) {
$maxIndex = 3;
if ($sum > $maxIndex)
return ($sum - $maxIndex) - 1;
else if ($sum return ($sum + $maxIndex) + 1; }
$sum を返します。
}
function AddUserIdToImageSrc($imageSrc) {
$name = end(explode(DIRECTORY_SEPARATOR, $imageSrc));
$this->name = $name;
$ext = end(explode('.', $name) );
$p = strlen($ext) + 1;
$f = str_replace(substr($imageSrc, -$p), "{$this->userId}.{$ext}", $name);
return $f;
}
function GetFormAction() {
$joomlaIsAdmin = isset($_GET['isadmin']) ? 'isadmin=' 。 $_GET['isadmin'] 。 '&' : '';
#return "index.php?".$joomlaIsAdmin.$this->httpImageKey."=".urlencode($this->srcEdit);
return "index.php?" 。 $joomlaIsAdmin 。 $this->httpImageKey 。 「=」。 urlencode($this->name);
}
function GetWidthKeepProportions() {
return $this->widthKeepProportions;
}
function GetHeightKeepProportions() {
return $this->heightKeepProportions;
}
$ vim phpimageeditor/lite/ shared/index.php
覆盖:
ini_set('default_charset', 'utf-8');
header("Cache-Control: no-store");
header('content-type: text/html; charset: utf-8');
include 'lite/shared/config.php';
include 'lite/shared/includes/constants.php';
include 'lite/shared/includes/functions.php';
include 'lite/shared/classes/phpimageeditor.php';
global $objPHPImageEditor;
$objPHPImageEditor = new PHPImageEditor();
    if (!$objPHPImageEditor->isAjaxPost) { ?>



PHP Image Editor
   
   
       
   
       
       
   
   
   
   
   
   

       





ErrorHasOccurred()) { ?>



">

texts["RESIZE IMAGE"]); ?>





">

texts["ROTATE IMAGE"]); ?>








">

texts["EFFECTS"]); ?>

























inputKeepProportions ? 'checked="checked"' : ''); ?>/>





texts["INSTRUCTIONS"]); ?>

texts["RESIZE HELP"]); ?>


 
関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート