diff --git a/API.article.md b/API.article.md index 2be41ef..0915c4a 100644 --- a/API.article.md +++ b/API.article.md @@ -32,7 +32,7 @@ Adds a child article to a parent article (creates and attaches with auto-generat *Source: `src/store/article/addImage.js`* -Adds an image to an article by its SKU, processing full, thumb, and 40px-edge small-thumb AVIF variants. +Adds an image to an article by its SKU, processing full, thumb, and 32px-edge small-thumb AVIF variants. **Parameters** diff --git a/API.brand.md b/API.brand.md index 78ea210..4955933 100644 --- a/API.brand.md +++ b/API.brand.md @@ -6,7 +6,7 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin *Source: `src/store/brand/addImage.js`* -Adds an image to a brand, processing full, thumb, and 40px-edge small-thumb AVIF variants. +Adds an image to a brand, processing full, thumb, and 32px-edge small-thumb AVIF variants. **Parameters** @@ -94,7 +94,7 @@ Lists the brands of the user's selected company, sorted by name. | `[opts]` | `object` | Optional pagination options. | | `[opts.offset=0]` | `number` | Number of brands to skip. | | `[opts.limit=10]` | `number` | Number of brands to return (max 100). | -| `[opts.includeSmallThumbs=false]` | `boolean` | Include 40px-edge small thumbnail dimensions and base64 AVIF data. | +| `[opts.includeSmallThumbs=false]` | `boolean` | Include 32px-edge small thumbnail dimensions and base64 AVIF data. | | `[tx]` | `object` | Optional transaction to run within. | **Returns** diff --git a/API.category.md b/API.category.md index eb4c51a..ddee9d8 100644 --- a/API.category.md +++ b/API.category.md @@ -6,7 +6,7 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin *Source: `src/store/category/addImage.js`* -Adds an image to a category, processing full, thumb, and 40px-edge small-thumb AVIF variants. +Adds an image to a category, processing full, thumb, and 32px-edge small-thumb AVIF variants. **Parameters** diff --git a/API.pic.md b/API.pic.md index 919d294..03ada26 100644 --- a/API.pic.md +++ b/API.pic.md @@ -35,7 +35,7 @@ const image = await store.pic.getImageByHash(42, 'abc123'); *Source: `src/store/pic/getSmallThumbByHash.js`* -Returns the small thumbnail image (AVIF, 40px max edge) for a given hash. +Returns the small thumbnail image (AVIF, 32px max edge) for a given hash. **Parameters** diff --git a/scripts/test-sqlite-storage.js b/scripts/test-sqlite-storage.js index 730028d..2907183 100644 --- a/scripts/test-sqlite-storage.js +++ b/scripts/test-sqlite-storage.js @@ -28,7 +28,7 @@ async function runTests() { assert(existsSync(join(storageDir, 'fullbinary')), 'fullbinary dir should exist'); assert(existsSync(join(storageDir, 'thumbbinary')), 'thumbbinary dir should exist'); - // Large file and image blobs stay on disk; the 40px small-thumb stays inline in pic. + // Large file and image blobs stay on disk; the 32px small-thumb stays inline in pic. const fileTableInfo = provider.db.pragma('table_info("file")'); const fileColNames = fileTableInfo.map((c) => c.name); console.log('file table columns:', fileColNames); diff --git a/src/store/article/addImage.js b/src/store/article/addImage.js index 2cf895e..3d298c5 100644 --- a/src/store/article/addImage.js +++ b/src/store/article/addImage.js @@ -22,7 +22,7 @@ export default function addImage(provider) { const addArticlePicSql = isSqlite ? SQLITE_ADD_ARTICLEPIC : MSSQL_ADD_ARTICLEPIC; /** - * Adds an image to an article by its SKU, processing full, thumb, and 40px-edge small-thumb AVIF variants. + * Adds an image to an article by its SKU, processing full, thumb, and 32px-edge small-thumb AVIF variants. * * @param {number} googleAuthId - The id of the Google auth user. * @param {string} sku - The article SKU. diff --git a/src/store/brand/addImage.js b/src/store/brand/addImage.js index 7bd3eee..ae580fc 100644 --- a/src/store/brand/addImage.js +++ b/src/store/brand/addImage.js @@ -22,7 +22,7 @@ export default function addImage(provider) { const addBrandPicSql = isSqlite ? SQLITE_ADD_BRANDPIC : MSSQL_ADD_BRANDPIC; /** - * Adds an image to a brand, processing full, thumb, and 40px-edge small-thumb AVIF variants. + * Adds an image to a brand, processing full, thumb, and 32px-edge small-thumb AVIF variants. * * @param {number} googleAuthId - The id of the Google auth user. * @param {number} brandId - The id of the brand. diff --git a/src/store/brand/list.js b/src/store/brand/list.js index dce60b2..1620648 100644 --- a/src/store/brand/list.js +++ b/src/store/brand/list.js @@ -46,7 +46,7 @@ export default function list(provider) { * @param {object} [opts] - Optional pagination options. * @param {number} [opts.offset=0] - Number of brands to skip. * @param {number} [opts.limit=10] - Number of brands to return (max 100). - * @param {boolean} [opts.includeSmallThumbs=false] - Include 40px-edge small thumbnail dimensions and base64 AVIF data. + * @param {boolean} [opts.includeSmallThumbs=false] - Include 32px-edge small thumbnail dimensions and base64 AVIF data. * @param {object} [tx] - Optional transaction to run within. * @returns {Promise<{brands: Array<{id: number, name: string, gsprpinfo: string|null, pics: Array<{fullHash: string, thumbW: number, thumbH: number, thumbHash: string, smallThumbW?: number|null, smallThumbH?: number|null, smallThumbBinary?: string|null}>}>, total: number, offset: number, limit: number}>} The brands plus the total unpaged count. Small-thumbnail fields are present only when `includeSmallThumbs` is true; the binary is base64-encoded AVIF data. * diff --git a/src/store/category/addImage.js b/src/store/category/addImage.js index 1c6d982..89e6d29 100644 --- a/src/store/category/addImage.js +++ b/src/store/category/addImage.js @@ -22,7 +22,7 @@ export default function addImage(provider) { const addCategoryPicSql = isSqlite ? SQLITE_ADD_CATEGORYPIC : MSSQL_ADD_CATEGORYPIC; /** - * Adds an image to a category, processing full, thumb, and 40px-edge small-thumb AVIF variants. + * Adds an image to a category, processing full, thumb, and 32px-edge small-thumb AVIF variants. * * @param {number} googleAuthId - The id of the Google auth user. * @param {number} categoryId - The id of the category. diff --git a/src/store/pic/getSmallThumbByHash.js b/src/store/pic/getSmallThumbByHash.js index 7529a8f..090acb5 100644 --- a/src/store/pic/getSmallThumbByHash.js +++ b/src/store/pic/getSmallThumbByHash.js @@ -8,7 +8,7 @@ export default function getSmallThumbByHash(provider) { const sql = provider?.dialect === 'sqlite3' ? SQLITE_GET : MSSQL_GET; /** - * Returns the small thumbnail image (AVIF, 40px max edge) for a given hash. + * Returns the small thumbnail image (AVIF, 32px max edge) for a given hash. * * @param {number} googleAuthId - The id of the Google auth user. * @param {string} fullHash - The full image hash. diff --git a/src/util/processAvifImage.js b/src/util/processAvifImage.js index 79e54b3..513649e 100644 --- a/src/util/processAvifImage.js +++ b/src/util/processAvifImage.js @@ -3,7 +3,7 @@ import { rgbaToThumbHash } from 'thumbhash'; const FULL_MAX = 1000; const THUMB_MAX = 200; -const SMALL_THUMB_MAX = 40; +const SMALL_THUMB_MAX = 32; export default async function processAvifImage(inputBuffer) { const input = Buffer.isBuffer(inputBuffer)