使用下面的代码,我通过 html 页面上的表单获取图像,在其中进行一些剪切并添加另一个图像,它运行良好。
我在从 html 表单获得的图像名称中遇到特殊字符问题...
简而言之,在您上传、裁剪图像、移动它们等之前,我必须处理它们的名称......删除空格、删除重音等等......
我尝试使用某些功能但没有成功..有人可以帮忙吗?
这是我的代码:
<?php
require( "./lib/WideImage.php");
// Example of accessing data for a newly uploaded file
$fileName = $_FILES["uploaded_file"]["name"];
$fileTmpLoc = $_FILES["uploaded_file"]["tmp_name"];
// Path and file name
$pathAndName = "cartelas/cart".$fileName;
// Run the move_uploaded_file() function here
$moveResult = move_uploaded_file($fileTmpLoc, $pathAndName);
// Evaluate the value returned from the function if needed
$image = WideImage::load($pathAndName);
$unh = WideImage::load("unh11.png");
$crop1 = $image->crop("25", "50", 111, 132);
$out1 = $crop1->merge($unh,'middle','middle');
$pathAndName1 = "unha-1-".$fileName;
$crop1->saveToFile('./cartelas/estampa'.$pathAndName1);
$out1->saveToFile('./cartelas/'.$pathAndName1);
echo "Imagens geradas:<BR>";
echo "<img src=./cartelas/estampa$pathAndName1><img src=./cartelas/$pathAndName1>";
?>
谢谢!