mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-16 19:47:34 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
"@isaacs/ttlcache": "1.4.1",
|
"@isaacs/ttlcache": "1.4.1",
|
||||||
"@nodebb/spider-detector": "2.0.3",
|
"@nodebb/spider-detector": "2.0.3",
|
||||||
"@popperjs/core": "2.11.8",
|
"@popperjs/core": "2.11.8",
|
||||||
"@resvg/resvg-js": "2.6.2",
|
|
||||||
"@textcomplete/contenteditable": "0.1.13",
|
"@textcomplete/contenteditable": "0.1.13",
|
||||||
"@textcomplete/core": "0.1.13",
|
"@textcomplete/core": "0.1.13",
|
||||||
"@textcomplete/textarea": "0.1.13",
|
"@textcomplete/textarea": "0.1.13",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"extends": [
|
"extends": [
|
||||||
"config:recommended"
|
"config:recommended"
|
||||||
],
|
],
|
||||||
"baseBranches": [
|
"baseBranchPatterns": [
|
||||||
"develop"
|
"develop"
|
||||||
],
|
],
|
||||||
"labels": [
|
"labels": [
|
||||||
@@ -14,8 +14,7 @@
|
|||||||
"dependencies"
|
"dependencies"
|
||||||
],
|
],
|
||||||
"rangeStrategy": "pin",
|
"rangeStrategy": "pin",
|
||||||
"matchPackageNames": [
|
"matchPackageNames": []
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"matchDepTypes": [
|
"matchDepTypes": [
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const fs = require('fs/promises');
|
|||||||
const nconf = require('nconf');
|
const nconf = require('nconf');
|
||||||
const winston = require('winston');
|
const winston = require('winston');
|
||||||
const { default: satori } = require('satori');
|
const { default: satori } = require('satori');
|
||||||
const { Resvg } = require('@resvg/resvg-js');
|
const sharp = require('sharp');
|
||||||
|
|
||||||
const utils = require('../utils');
|
const utils = require('../utils');
|
||||||
|
|
||||||
@@ -96,9 +96,9 @@ Icons.regenerate = async (cid) => {
|
|||||||
await fs.writeFile(path.resolve(nconf.get('upload_path'), 'category', `category-${cid}-icon.svg`), svg);
|
await fs.writeFile(path.resolve(nconf.get('upload_path'), 'category', `category-${cid}-icon.svg`), svg);
|
||||||
|
|
||||||
// Generate and save PNG
|
// Generate and save PNG
|
||||||
const resvg = new Resvg(Buffer.from(svg));
|
const pngBuffer = await sharp(Buffer.from(svg))
|
||||||
const pngData = resvg.render();
|
.png()
|
||||||
const pngBuffer = pngData.asPng();
|
.toBuffer();
|
||||||
|
|
||||||
await fs.writeFile(path.resolve(nconf.get('upload_path'), 'category', `category-${cid}-icon.png`), pngBuffer);
|
await fs.writeFile(path.resolve(nconf.get('upload_path'), 'category', `category-${cid}-icon.png`), pngBuffer);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user