图片盲水印处理
Last updated
2023-07-17 13:58:22
{"value":"\u8089\u773c\u53ef\u89c1\u7684\u6c34\u5370\u65b9\u5f0f\uff0c\u4e00\u822c\u7528\u4e8e\u6807\u5fd7\u56fe\u7247\u7684\u51fa\u5904\u6216\u8005\u7528\u4e8e\u58f0\u660e\u7248\u6743\uff0c\u4f1a\u7834\u574f\u539f\u56fe\uff0c\u4e14\u5f71\u54cd\u7f8e\u89c2\u3002\u4e91\u5b58\u50a8\u63d0\u4f9b\u76f2\u6c34\u5370\u529f\u80fd\uff0c\u9690\u853d\u6027\u5f3a\uff0c\u5728\u4e0d\u7834\u574f\u539f\u59cb\u4f5c\u54c1\u7684\u60c5\u51b5\u4e0b\uff0c\u5b9e\u73b0\u7248\u6743\u7684\u9632\u62a4\u4e0e\u8ffd\u8e2a\u3002\u5f53\u56fe\u7247\u88ab\u76d7\u7528\u540e\uff0c\u60a8\u53ef\u5bf9\u56fe\u7247\u8fdb\u884c\u76f2\u6c34\u5370\u89e3\u7801\uff0c\u9a8c\u8bc1\u7248\u6743\u5f52\u5c5e\u3002\n\n\u76f2\u6c34\u5370\u529f\u80fd\u6709\u4e24\u79cd\u7c7b\u578b\uff1a\n\n| \u6c34\u5370\u7c7b\u578b | \u8bf4\u660e |\n| ---------- | ---------------------------- |\n| \u56fe\u7247\u76f2\u6c34\u5370 | \u5c06\u56fe\u7247\u4f5c\u4e3a\u76f2\u6c34\u5370\u6dfb\u52a0\u5230\u56fe\u7247\u4e2d |\n| \u6587\u5b57\u76f2\u6c34\u5370 | \u5c06\u6587\u5b57\u4f5c\u4e3a\u76f2\u6c34\u5370\u6dfb\u52a0\u5230\u56fe\u7247\u4e2d |\n\n## **\u9650\u5236\u8bf4\u660e**\n\n- \u539f\u56fe\u9650\u5236\uff1a\n - \u683c\u5f0f\u652f\u6301 jpg\u3001png\n - \u5bbd\u9ad8\u9650\u5236\u4e3a\uff1a4096x4096\n - version\u4e3a3\u65f6\uff0c\u539f\u56fe\u7684\u5c3a\u5bf8\u5bbd\u9ad8\u90fd\u9700\u5927\u4e8e512\n- \u7f16\u7801\u3001\u89e3\u7801\u7684 version \u8981\u76f8\u540c\n- \u76f2\u6c34\u5370\u4e3b\u8981\u4e3aCPU\u5bc6\u96c6\u578b\u4efb\u52a1\uff0c\u5904\u7406\u65f6\u95f4\u4f1a\u968f\u7740\u56fe\u7247\u6587\u4ef6\u7684\u589e\u5927\u800c\u589e\u5927\uff1b\u4e5f\u53ef\u4ee5\u4f7f\u7528 \u6301\u4e45\u5316\u5904\u7406\u65b9\u5f0f\n- \u5efa\u8bae\u4f7f\u7528 version\/3\uff0c\u76f8\u8f83\u4e8e\u4e4b\u524d\u7684\u7248\u672c\u6709\u4ee5\u4e0b\u4f18\u5316\uff1a\n - \u89e3\u6c34\u5370\u4e0d\u9700\u8981\u5bf9\u6bd4\u539f\u56fe\uff0c\u53bb\u9664\u5bf9\u539f\u56fe\u7684\u4f9d\u8d56\n - \u6297\u5927\u9762\u79ef\u6d82\u62b9&\u88c1\u526a\u653b\u51fb\n\n## **\u5e94\u7528\u573a\u666f**\n\n**\u9690\u5f62\u7f8e\u89c2**\n\n\u76f2\u6c34\u5370\u662f\u4e00\u79cd\u8089\u773c\u4e0d\u53ef\u89c1\u7684\u6c34\u5370\u65b9\u5f0f\uff0c\u53ef\u4ee5\u4fdd\u6301\u56fe\u7247\u7f8e\u89c2\u7684\u540c\u65f6\uff0c\u4fdd\u62a4\u60a8\u7684\u8d44\u6e90\u7248\u6743\u3002\n\n**\u7248\u6743\u4fdd\u62a4**\n\n\u5bf9\u56fe\u7247\u8d44\u6e90\u4f7f\u7528\u56fe\u7247\u76f2\u6c34\u5370\u6216\u8005\u6587\u5b57\u6c34\u5370\uff0c\u501f\u6b64\u907f\u514d\u6570\u5b57\u5a92\u4f53\u672a\u7ecf\u6388\u6743\u7684\u590d\u5236\u548c\u62f7\u8d1d\uff0c\u53ef\u901a\u8fc7\u5bf9\u539f\u56fe\u8fdb\u884c\u89e3\u7801\u64cd\u4f5c\uff0c\u5f97\u5230\u6c34\u5370\u56fe\u6765\u8bc1\u660e\u7248\u6743\u5f52\u5c5e\u3002\n\n**\u9632\u6cc4\u6f0f**\n\n\u5bf9\u4e8e\u5185\u90e8\u5206\u4eab\u7684\u56fe\u7247\u8d44\u6e90\uff0c\u60a8\u53ef\u4f7f\u7528\u76f2\u6c34\u5370\u529f\u80fd\uff0c\u52a0\u4e0a\u4e0d\u540c\u6807\u8bc6\uff0c\u5982\u679c\u8d44\u6599\u88ab\u590d\u5236\u3001\u4f20\u64ad\u53ef\u6839\u636e\u89e3\u7801\u51fa\u7684\u552f\u4e00\u6807\u8bc6\u5f97\u51fa\u6cc4\u9732\u65b9\u4fe1\u606f\u3002\n\n## **\u56fe\u7247\u76f2\u6c34\u5370**\n\n## **\u63a5\u53e3\u89c4\u683c**\n\n```\nwatermark\/5\n \/version\/<version>\n \/method\/<method>\n \/imageKey\/<encodedImageKey>\n \/orignal\/<encodedImage>\n```\n\n## \u53c2\u6570\u8bf4\u660e\n\n### \u6dfb\u52a0\u6c34\u5370\n\nversion \u4e3a1\u62162\u65f6\uff0c\u8bf7\u6c42\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a\n\n| \u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| ----------------------------- | :--: | ------------------------------------------------------------ |\n| `\/version\/<version>` | N | \u63a5\u53e3\u7248\u672c\u503c\u4e3a1\u62162 , \u9ed8\u8ba4\u4e3a 1\u3002 |\n| `\/method\/<method>` | Y | \u76f2\u6c34\u5370\u6807\u5fd7\u4f4d\uff0c\u7f16\u7801\uff08\u6dfb\u52a0\u6c34\u5370\uff09\u4e3aencode\u3002 |\n| `\/imageKey\/<encodedImageKey>` | N | \u6c34\u5370\u56fe\u7247\uff08\u7ecf\u8fc7URL\u5b89\u5168\u7684Base64\u7f16\u7801\uff09\uff0c\u56fe\u7247\u6765\u6e90\u4e3a\u4e03\u725bbucket\uff08\u9700\u8981\u4e0e\u8f93\u5165\u56fe\u7247\u5728\u540c\u4e00\u4e2abucket\u4e2d\uff09\u3002 **\u4f8b\u5982**\uff1aimageKey=upload.png\uff0cencodedImageKey=urlsafe_base64_encode(imageKey)\u3002 **\u6ce8\u610f**\uff1a\u6c34\u5370\u56fe\u7247\u5bbd\u9ad8\u5206\u522b\u4e0d\u8d85\u8fc7\u539f\u56fe\u5bbd\u9ad8\u7684\u4e8c\u5206\u4e4b\u4e00\uff0c\u56fe\u7247\u4e3a\u9ed1\u5e95\u767d\u5b57\u6548\u679c\u66f4\u4f73\u3002 |\n\nversion \u4e3a3\u65f6\uff0c\u8bf7\u6c42\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a\n\n| \u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| ----------------------------- | ---- | ------------------------------------------------------------ |\n| `\/version\/<version>` | N | \u63a5\u53e3\u7248\u672c\u503c\u4e3a3\uff0c\u6ce8\u610f\uff1a 1\uff09\u539f\u56fe\u7684\u5bbd\u9ad8\u90fd\u9700\u5927\u4e8e512\u3002 2\uff09\u6c34\u5370\u56fe\u7247\u7684\u9650\u5236\uff0c\u5fc5\u987b\u662f\u4e8c\u503c\u56fe\u50cf\uff0c\u4e14\u6c34\u5370\u7684\u5927\u5c0f\u4e3a64x64\uff0c\u5982\u679c\u4e0d\u7b26\u5408\u6761\u4ef6\uff0c \u4f1a\u7f29\u653e\u548c\u5904\u7406\u56fe\u7247\u5230\u670d\u52a1\u8981\u6c42\u3002 |\n| `\/method\/<method>` | Y | \u76f2\u6c34\u5370\u6807\u5fd7\u4f4d\uff0c\u7f16\u7801\uff08\u5373\u6dfb\u52a0\u6c34\u5370\uff09\u4e3aencode\u3002 |\n| `\/imageKey\/<encodedImageKey>` | N | \u6c34\u5370\u56fe\u7247\uff08\u7ecf\u8fc7URL\u5b89\u5168\u7684Base64\u7f16\u7801\uff09\uff0c\u56fe\u7247\u6765\u6e90\u4e3a\u4e03\u725bbucket\uff08\u9700\u8981\u4e0e\u8f93\u5165\u56fe\u7247\u5728\u540c\u4e00\u4e2abucket\u4e2d\uff09\u3002 **\u4f8b\u5982**\uff1aimageKey=upload.png\uff0cencodedImageKey=urlsafe_base64_encode(imageKey)\u3002 |\n\n### \u63d0\u53d6\u6c34\u5370\n\nversion \u4e3a1\u62162\u65f6\uff0c\u8bf7\u6c42\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a\n\n| \u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| ------------------------- | ---- | ------------------------------------------------------------ |\n| `\/version\/<version>` | N | \u63a5\u53e3\u7248\u672c\u503c\u4e3a1\u62162 , \u9ed8\u8ba4\u4e3a 1\u3002 |\n| `\/method\/<method>` | Y | \u76f2\u6c34\u5370\u6807\u5fd7\u4f4d\uff0c\u89e3\u7801\uff08\u5373\u63d0\u53d6\u6c34\u5370\uff09\u4e3adecode\u3002 |\n| `\/orignal\/<encodedImage>` | N | \u89e3\u7801\u5bf9\u6bd4\u539f\u56fe\uff08\u7ecf\u8fc7URL\u5b89\u5168\u7684Base64\u7f16\u7801\uff09\uff0c\u56fe\u7247\u6765\u6e90\u4e3a\u4e03\u725bbucket\uff08\u9700\u8981\u4e0e\u8f93\u5165\u56fe\u7247\u5728\u540c\u4e00\u4e2abucket\u4e2d\uff09\u3002 |\n\nversion \u4e3a3\u65f6\uff0c\u8bf7\u6c42\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a\n\n| \u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| -------------------- | ---- | -------------------------------------------- |\n| `\/version\/<version>` | N | \u63a5\u53e3\u7248\u672c\u503c\u4e3a3\uff0c\u6ce8\u610f\uff1a\u539f\u56fe\u7684\u5bbd\u9ad8\u90fd\u9700\u5927\u4e8e512\u3002 |\n| `\/method\/<method>` | Y | \u76f2\u6c34\u5370\u6807\u5fd7\u4f4d\uff0c\u89e3\u7801\uff08\u5373\u63d0\u53d6\u6c34\u5370\uff09\u4e3adecode\u3002 |\n\n\n\n## **\u6587\u5b57\u76f2\u6c34\u5370**\n\n## **\u63a5\u53e3\u89c4\u683c**\n\n```\nwatermark\/6\n \/version\/<version>\n \/method\/<method>\n \/text\/<encodedText>\n \/orignal\/<encodedImage>\n```\n\n## \u53c2\u6570\u8bf4\u660e\n\n### \u6dfb\u52a0\u6c34\u5370\n\nversion \u4e3a1\u548c2\u65f6\uff0c\u8bf7\u6c42\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a\n\n| \u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| --------------------- | ---- | ------------------------------------------------------------ |\n| `\/version\/<version>` | N | \u63a5\u53e3\u7248\u672c \u53ef\u90091\u30012 , \u9ed8\u8ba4\u4e3a 1\u3002 |\n| `\/method\/<method>` | Y | \u76f2\u6c34\u5370\u6807\u5fd7\u4f4d\uff0c\u7f16\u7801\uff08\u6dfb\u52a0\u6c34\u5370\uff09\u4e3aencode\u3002 |\n| `\/text\/<encodedText>` | N | \u6c34\u5370\u6587\u5b57\uff08\u7ecf\u8fc7URL\u5b89\u5168\u7684Base64\u7f16\u7801\uff09\u3002\u53ea\u652f\u6301\u82f1\u6587\u6570\u5b57\u5b57\u7b26\uff0c\u4e0d\u652f\u6301\u4e2d\u6587\u5b57\u7b26\uff0c\u6570\u91cf\u4e0a\u9650\u5206\u522b\u4e3a 10\u3002 |\n\nversion \u4e3a3\u65f6\uff0c\u8bf7\u6c42\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a\n\n| \u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| --------------------- | ---- | ------------------------------------------------------------ |\n| `\/version\/<version>` | N | \u7248\u672c\u4e3a3\u65f6\uff0c\u6ce8\u610f\uff1a\u539f\u56fe\u7684\u5bbd\u9ad8\u90fd\u9700\u5927\u4e8e512\u3002 |\n| `\/method\/<method>` | Y | \u76f2\u6c34\u5370\u6807\u5fd7\u4f4d\uff0c\u7f16\u7801\uff08\u6dfb\u52a0\u6c34\u5370\uff09\u4e3aencode\u3002 |\n| `\/text\/<encodedText>` | N | \u6c34\u5370\u6587\u5b57\uff08\u7ecf\u8fc7URL\u5b89\u5168\u7684Base64\u7f16\u7801\uff09\u3002\u53ea\u652f\u6301\u82f1\u6587\u6570\u5b57\u5b57\u7b26\uff0c\u4e0d\u652f\u6301\u4e2d\u6587\u5b57\u7b26\uff0c\u6570\u91cf\u4e0a\u9650\u5206\u522b\u4e3a 15\u3002 |\n\n### \u63d0\u53d6\u6c34\u5370\n\nversion \u4e3a1\u548c2\u65f6\uff0c\u8bf7\u6c42\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a\n\n| \u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| ------------------------- | ---- | ------------------------------------------------------------ |\n| `\/version\/<version>` | N | \u63a5\u53e3\u7248\u672c \u53ef\u90091\u30012 , \u9ed8\u8ba4\u4e3a 1\u3002 |\n| `\/method\/<method>` | Y | \u76f2\u6c34\u5370\u6807\u5fd7\u4f4d\uff0c\u89e3\u7801\uff08\u5373\u63d0\u53d6\u6c34\u5370\uff09\u4e3adecode\u3002 |\n| `\/orignal\/<encodedImage>` | N | \u89e3\u7801\u5bf9\u6bd4\u539f\u56fe\uff08\u7ecf\u8fc7URL\u5b89\u5168\u7684Base64\u7f16\u7801\uff09\uff0c\u56fe\u7247\u6765\u6e90\u4e3a\u4e03\u725bbucket\uff08\u9700\u8981\u4e0e\u8f93\u5165\u56fe\u7247\u5728\u540c\u4e00\u4e2abucket\u4e2d\uff09\u3002 |\n\nversion \u4e3a3\u65f6\uff0c\u8bf7\u6c42\u53c2\u6570\u8bf4\u660e\u5982\u4e0b\uff1a\n\n| \u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| -------------------- | ---- | ------------------------------------------ |\n| `\/version\/<version>` | N | \u7248\u672c\u4e3a3\u65f6\uff0c\u6ce8\u610f\uff1a\u539f\u56fe\u7684\u5bbd\u9ad8\u90fd\u9700\u5927\u4e8e512\u3002 |\n| `\/method\/<method>` | Y | \u76f2\u6c34\u5370\u6807\u5fd7\u4f4d\uff0c\u89e3\u7801\uff08\u5373\u63d0\u53d6\u6c34\u5370\uff09\u4e3adecode\u3002 |\n"}