Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2025-07-25 10:54:27 -04:00
3 changed files with 6 additions and 8 deletions

View File

@@ -35,7 +35,6 @@
"@isaacs/ttlcache": "1.4.1",
"@nodebb/spider-detector": "2.0.3",
"@popperjs/core": "2.11.8",
"@resvg/resvg-js": "2.6.2",
"@textcomplete/contenteditable": "0.1.13",
"@textcomplete/core": "0.1.13",
"@textcomplete/textarea": "0.1.13",

View File

@@ -2,7 +2,7 @@
"extends": [
"config:recommended"
],
"baseBranches": [
"baseBranchPatterns": [
"develop"
],
"labels": [
@@ -14,8 +14,7 @@
"dependencies"
],
"rangeStrategy": "pin",
"matchPackageNames": [
]
"matchPackageNames": []
},
{
"matchDepTypes": [

View File

@@ -5,7 +5,7 @@ const fs = require('fs/promises');
const nconf = require('nconf');
const winston = require('winston');
const { default: satori } = require('satori');
const { Resvg } = require('@resvg/resvg-js');
const sharp = require('sharp');
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);
// Generate and save PNG
const resvg = new Resvg(Buffer.from(svg));
const pngData = resvg.render();
const pngBuffer = pngData.asPng();
const pngBuffer = await sharp(Buffer.from(svg))
.png()
.toBuffer();
await fs.writeFile(path.resolve(nconf.get('upload_path'), 'category', `category-${cid}-icon.png`), pngBuffer);