This commit is contained in:
seb
2026-08-01 03:37:45 +02:00
parent 69a24192d3
commit 1756dc7ef0
10 changed files with 179 additions and 13 deletions

View File

@@ -2,6 +2,7 @@ import { GET_CATEGORY_ID_BY_SKU } from '../../sql/article.js';
import { ADD as ADD_ARTICLEPIC, GET_NEXT_SORT } from '../../sql/articlepic.js';
import { CREATE as CREATE_PIC } from '../../sql/pic.js';
import processAvifImage from '../../util/processAvifImage.js';
import newFullHash from '../../util/newFullHash.js';
import resolveCategoryAccess from '../category/resolveCategoryAccess.js';
import request from '../request.js';
@@ -32,12 +33,13 @@ export default function addImage(pool) {
.query(GET_NEXT_SORT);
const sort = sortResult.recordset[0].sort;
const fullHash = newFullHash();
const picResult = await request(pool, tx)
.input('w', processed.full.w)
.input('h', processed.full.h)
.input('size', processed.full.size)
.input('hash', processed.full.hash)
.input('hash', fullHash)
.input('thumbw', processed.thumb.w)
.input('thumbh', processed.thumb.h)
.input('thumbhash', processed.thumb.hash)
@@ -68,7 +70,7 @@ export default function addImage(pool) {
w: processed.thumb.w,
h: processed.thumb.h,
},
fullHash: processed.full.hash,
fullHash,
thumbHash: processed.thumb.hash,
};
} catch (err) {