XiunoBBS论坛已经上线了图片水印功能,不过大尺寸图片添加水印会错位或者看不到,这是JS文件默认值限制了;
程序里找到 view/js/xiuno.js 打开,找到1117行、1257行,默认宽度1200px,根据自身情况调整大点即可;
- xn.upload_file = function(file, upload_url, postdata, complete_callback, progress_callback, thumb_callback) {
- postdata = postdata || {};
- postdata.width = postdata.width || 1600; //默认宽度
- postdata.height = postdata.height || 2800; //默认高度

- xn.image_resize = function(file_base64_data, callback, options) {
- var thumb_width = options.width || 1600;
- var thumb_height = options.height || 2800;

默认添加图片水印透明度找到1207行调整即可;
- ctx.globalAlpha = 1;
- ctx.beginPath();
- ctx.drawImage(water_img, 0, 0, water_width, water_height, x, y, water_width, water_height);
- ctx.closePath();
- ctx.save();
