diff --git a/admin/scripts/image-resize.mjs b/admin/scripts/image-resize.mjs index e8b8718e1d..294289e74d 100644 --- a/admin/scripts/image-resize.mjs +++ b/admin/scripts/image-resize.mjs @@ -12,6 +12,7 @@ import fs from 'fs-extra'; import path from 'path'; import imageSize from 'image-size'; import {fileURLToPath} from 'url'; +import logger from '@docusaurus/logger'; const allImages = ( await fs.readdir(new URL('../../website/src/data/showcase', import.meta.url)) @@ -27,10 +28,11 @@ await Promise.all( ); const {width, height} = imageSize(imgPath); if (width === 640 && height === 320) { - // Do not emit if no resized. Important because we - // can't guarantee idempotency during resize -> optimization + // Do not emit if not resized. Important because we can't guarantee + // idempotency during resize -> optimization return; } + logger.info`Resized path=${imgPath}: Before number=${width}×number=${height}`; const data = await sharp(imgPath) .resize(640, 320, {fit: 'cover', position: 'top'}) .png() diff --git a/website/src/data/__tests__/user.test.ts b/website/src/data/__tests__/user.test.ts index bb3b83d91f..1489ff70db 100644 --- a/website/src/data/__tests__/user.test.ts +++ b/website/src/data/__tests__/user.test.ts @@ -27,11 +27,11 @@ expect.extend({ toHaveGoodDimensions({width, height}: {width: number; height: number}) { // Put this one first because aspect ratio is harder to fix than resizing // (need to take another screenshot) - if (width / height < 0.5) { + if (width / height > 2) { return { pass: false, message: () => - `The preview image's width is ${width} and height is ${height}. To make sure it takes up the entire container in our showcase card, it needs to have a minimum aspect ratio of 2:1. Please make your image taller.`, + `The preview image's width is ${width} and height is ${height}. To make sure it takes up the entire container in our showcase card, it needs to have an aspect ratio of no wider than 2:1. Please make your image taller.`, }; } else if (width < 640) { return { diff --git a/website/src/data/showcase/evantay.png b/website/src/data/showcase/evantay.png index df76a01cbe..baeb1a467b 100644 Binary files a/website/src/data/showcase/evantay.png and b/website/src/data/showcase/evantay.png differ diff --git a/website/src/data/users.tsx b/website/src/data/users.tsx index 00f2e5988c..fdf4377c2e 100644 --- a/website/src/data/users.tsx +++ b/website/src/data/users.tsx @@ -559,7 +559,7 @@ const Users: User[] = [ tags: ['opensource', 'personal', 'i18n'], }, { - title: "Evan Tay's Personal Website", + title: "KayaFolio", description: "A Software Engineer's blog, documentation and project portfolio.", preview: require('./showcase/evantay.png'),