wip (#8101)
This commit is contained in:
parent
e6c8b83b20
commit
87c5c69c87
1 changed files with 3 additions and 3 deletions
|
@ -160,7 +160,7 @@ export async function generateAlts(path: string, type: string, generateWeb: bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!['image/jpeg', 'image/png', 'image/webp'].includes(type)) {
|
if (!['image/jpeg', 'image/png', 'image/webp', 'image/svg+xml'].includes(type)) {
|
||||||
logger.debug(`web image and thumbnail not created (not an required file)`);
|
logger.debug(`web image and thumbnail not created (not an required file)`);
|
||||||
return {
|
return {
|
||||||
webpublic: null,
|
webpublic: null,
|
||||||
|
@ -201,7 +201,7 @@ export async function generateAlts(path: string, type: string, generateWeb: bool
|
||||||
webpublic = await convertSharpToJpeg(img, 2048, 2048);
|
webpublic = await convertSharpToJpeg(img, 2048, 2048);
|
||||||
} else if (['image/webp'].includes(type)) {
|
} else if (['image/webp'].includes(type)) {
|
||||||
webpublic = await convertSharpToWebp(img, 2048, 2048);
|
webpublic = await convertSharpToWebp(img, 2048, 2048);
|
||||||
} else if (['image/png'].includes(type)) {
|
} else if (['image/png', 'image/svg+xml'].includes(type)) {
|
||||||
webpublic = await convertSharpToPng(img, 2048, 2048);
|
webpublic = await convertSharpToPng(img, 2048, 2048);
|
||||||
} else {
|
} else {
|
||||||
logger.debug(`web image not created (not an required image)`);
|
logger.debug(`web image not created (not an required image)`);
|
||||||
|
@ -220,7 +220,7 @@ export async function generateAlts(path: string, type: string, generateWeb: bool
|
||||||
try {
|
try {
|
||||||
if (['image/jpeg', 'image/webp'].includes(type)) {
|
if (['image/jpeg', 'image/webp'].includes(type)) {
|
||||||
thumbnail = await convertSharpToJpeg(img, 498, 280);
|
thumbnail = await convertSharpToJpeg(img, 498, 280);
|
||||||
} else if (['image/png'].includes(type)) {
|
} else if (['image/png', 'image/svg+xml'].includes(type)) {
|
||||||
thumbnail = await convertSharpToPngOrJpeg(img, 498, 280);
|
thumbnail = await convertSharpToPngOrJpeg(img, 498, 280);
|
||||||
} else {
|
} else {
|
||||||
logger.debug(`thumbnail not created (not an required file)`);
|
logger.debug(`thumbnail not created (not an required file)`);
|
||||||
|
|
Loading…
Reference in a new issue