Code Monkey home page Code Monkey logo

Comments (1)

skliffmueller avatar skliffmueller commented on July 17, 2024 1

watermarkjs was built with the intent to only run on client side as it relies on the HTMLCanvasContext elements to exist which is only native to browsers. Typically you'd watermark on client side then upload the watermarked image to the server.

You might be able to do some hackery, or fork and update watermarkjs to use something like this https://github.com/Automattic/node-canvas to give node js canvas abilities.

The traditional way is to use something like graphicmagick gm Here is some articles on how to do that
http://www.proccli.com/2013/10/watermark-images-with-node.js-and-graphicsmagick
https://stackoverflow.com/questions/24375090/node-js-express-and-gm-graphicsmagick-adding-watermarks-and-general-image
aheckmann/gm#276

Note: You must install graphicsmagick library on your system, or the server itself. Here are some Dockerfiles which show some of the resources you will have to install via aptitude, or apk
https://hub.docker.com/r/jameskyburz/graphicsmagick-alpine/dockerfile
https://github.com/jtblin/debian-node-graphicsmagick/blob/master/Dockerfile

And a general guide to installation:
http://www.graphicsmagick.org/README.html

from watermarkjs.

Related Issues (20)

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.