GithubHelp home page GithubHelp logo

cleverliurx / l-watermark Goto Github PK

View Code? Open in Web Editor NEW
49.0 49.0 11.0 815 KB

A web watermark SDK, support: custom watermark content and style, watermark encryption and decryption, watermark anomaly monitoring, etc.

License: MIT License

TypeScript 100.00%

l-watermark's People

Contributors

cleverliurx avatar ikkz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

l-watermark's Issues

对暗水印加密的图片截图,解密失败

WaterMark.image({
target: document.getElementById("demo-image"),
text: "User Id: 1008611",
position: 'center',
secret: true,
})

然后对生成的图片截图,拿截图去解密,就解密不出来~

// 图片水印显示
const decodeImage = async () => {
const demoImg = document.getElementById("demo-image2"); // 图片截图
const decodeSrc = await WaterMark.utils.decodeImage(demoImg.src)
document.getElementById("imgDom").src = decodeSrc
}
decodeImage()

图片添加图片水印cSpace和vSpace无效

这是我的参数

{
    "target": "/uploads/imgs/20230128/69afdded-75ee-4d36-9b2d-c8bfc8633934.webp",
    "image": "/uploads/imgs/20230128/ce9552c1-23fa-49d9-a9b9-24286c7ae4ec.jpeg",
    "imageWidth": 50,
    "imageHeight": 50,
    "position": "repeat",
    "cSpace": 20,
    "vSpace": 20
}

image

如上图所示,平铺并没有间隙

页面出现了多个水印

使用中发现当手动改变水印元素的属性时会重新添加一个新的水印,原来的水印并没有移除掉,页面上就同时出现了多个水印叠加

const newTarget = this.targetClone.cloneNode(true) as HTMLElement
this.targetParent.appendChild(newTarget)
this.target = newTarget

这里新添加元素之后 GuardDom.target 也没有和 PageWaterMark.watermakr 同步,导致 PageWaterMark.remove 只能移除掉最开始的那个水印元素

page 水印文字模糊

看起来是 canvas 绘图共有的问题,能否优化一下呢 @CleverLiurx

const watermark = WaterMark.page({
  containerEl: document.body,
  text: '预览模式',
  color: `${theme.semanticColors.bodyText}44`,
  fontSize: 16,
  vSpace: 35,
  cSpace: 35,
});

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.