本文整理汇总了PHP中SimpleImage::imagesave方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleImage::imagesave方法的具体用法?PHP SimpleImage::imagesave怎么用?PHP SimpleImage::imagesave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleImage
的用法示例。
在下文中一共展示了SimpleImage::imagesave方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct($path, $thumb_img_resize_width = "200")
{
$answer = NULL;
$this->dir = $path;
$result_files = array();
foreach ($_FILES as $key => $value) {
$path_parts = pathinfo($value['name']);
$extension = $path_parts['extension'];
//$new_name_file = 'img_' . time() . '.' . $extension;
$new_name_file = $value['name'];
if (!file_exists($this->dir)) {
mkdir($this->dir);
}
//Картинки
if ($extension == "jpg" || $extension == "jpeg" || $extension == "gif" || $extension == "png") {
if (file_exists($this->dir . $value['name'])) {
$answer .= $value['name'] . " ";
} else {
//Размер изображения
move_uploaded_file($value['tmp_name'], $this->dir . $new_name_file);
//echo $this -> dir . "/" . $new_name_file;
//print_r($_FILES);
if (!file_exists($this->dir . 'thumb/')) {
mkdir($this->dir . 'thumb/');
}
$new_image = new SimpleImage($this->dir . $new_name_file);
$new_image->imageresizewidth($thumb_img_resize_width);
$new_image->imagesave($new_image->image_type, $this->dir . 'thumb/' . $new_name_file);
$new_image->imageout();
//array_push($result_files, $new_name_file);
}
} else {
if (file_exists($this->dir . $value['name'])) {
$answer .= $value['name'] . " ";
} else {
//Размер изображения
move_uploaded_file($value['tmp_name'], $this->dir . $new_name_file);
//array_push($result_files, $new_name_file);
}
}
sleep(1);
}
echo "ok";
exit;
}