You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-13 11:43:58 +08:00
修复文字水印透明度不生效
This commit is contained in:
@@ -285,7 +285,8 @@ class Imgs
|
||||
return array('code' => false, 'msg' => '请给正确的字体颜色');
|
||||
}
|
||||
|
||||
$def['color'] = imagecolorallocatealpha($dst_img, $rgb[0], $rgb[1], $rgb[2], $rgb[3]);
|
||||
// ceil(127 - 127 * $rgb[3]) 将CSS中的Alpha 0-1 转换为PHP Alpha 127-0 并取整
|
||||
$def['color'] = imagecolorallocatealpha($dst_img, $rgb[0], $rgb[1], $rgb[2], ceil(127 - 127 * $rgb[3]));
|
||||
imagettftext(
|
||||
$dst_img,
|
||||
$def['fontSize'],
|
||||
|
||||
@@ -39,7 +39,7 @@ function water($source)
|
||||
'name' => $source,
|
||||
'font' => APP_ROOT . $config['textFont'],
|
||||
'fontSize' => $config['textSize'],
|
||||
'color' => $config['textColor'],
|
||||
'color' => str_replace(array('rgba', '(', ')'), '', $config['textColor']),
|
||||
];
|
||||
Imgs::setWater($source, $arr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user