@@ -109,11 +109,18 @@ class Image
public function waterMark($filePath, $waterText, $alpha = 30, $type = 0, $waterText2 = '', $width = 0, $height = 0)
{
// 创建图片资源
- $image = imagecreatefromjpeg($filePath);
+ $image_info = getimagesize($filePath);
+ $image_type = $image_info[2];
+ if ($image_type == IMAGETYPE_JPEG) {
+ $image = imagecreatefromjpeg($filePath);
+ // 处理JPEG图片的逻辑
+ } elseif ($image_type == IMAGETYPE_PNG) {
+ $image = imagecreatefrompng($filePath);
+ // 处理PNG图片的逻辑
+ }
if (!$image) {
return false;
}
-
// 获取图片尺寸
$width = imagesx($image);
$height = imagesy($image);
@@ -18,7 +18,7 @@
<div class="am-form-group">
<label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">资质分类 </label>
<div class="am-u-sm-9 am-u-end">
- <select name="category_id"
+ <select name="certificate_category_id"
data-am-selected="{searchBox: 1, btnSize: 'sm',
placeholder:'请选择', maxHeight: 400}">
<option value=""></option>