diff --git a/README.md b/README.md index 0f38a9f..cf40618 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ thumbnail_light.png (for light theme) and thumbnail_dark.png (for dark theme) These images must be exactly 160x160 pixels. They are displayed in the grid list view. #### 3. Banners banner_light.png (for light theme) and banner_dark.png (for dark theme) -These images must be no larger than 274x105 pixels. They are used when your product appears in the featured carousel. +These images must be no larger than 274px wide. But **must** be 60px high. They are used when your product appears in the featured carousel. Note: Files ending with `_light.png` are for the light theme, and those ending with `_dark.png` are for the dark theme. diff --git a/partners/Stakeflow/banner_dark.png b/partners/Stakeflow/banner_dark.png index 4459a49..9889855 100644 Binary files a/partners/Stakeflow/banner_dark.png and b/partners/Stakeflow/banner_dark.png differ diff --git a/partners/Stakeflow/banner_light.png b/partners/Stakeflow/banner_light.png index 4459a49..6c1e442 100644 Binary files a/partners/Stakeflow/banner_light.png and b/partners/Stakeflow/banner_light.png differ diff --git a/partners/SubQuery Decentralised RPCs/banner_dark.png b/partners/SubQuery Decentralised RPCs/banner_dark.png index 422f5a6..7576342 100644 Binary files a/partners/SubQuery Decentralised RPCs/banner_dark.png and b/partners/SubQuery Decentralised RPCs/banner_dark.png differ diff --git a/partners/VIA Labs/banner_dark.png b/partners/VIA Labs/banner_dark.png index b49d6fc..c76cd1f 100644 Binary files a/partners/VIA Labs/banner_dark.png and b/partners/VIA Labs/banner_dark.png differ diff --git a/partners/VIA Labs/banner_light.png b/partners/VIA Labs/banner_light.png index b7e29f6..aec2956 100644 Binary files a/partners/VIA Labs/banner_light.png and b/partners/VIA Labs/banner_light.png differ diff --git a/partners/Web3CDN/banner_dark.png b/partners/Web3CDN/banner_dark.png index db04635..860a02b 100644 Binary files a/partners/Web3CDN/banner_dark.png and b/partners/Web3CDN/banner_dark.png differ diff --git a/partners/Web3CDN/banner_light.png b/partners/Web3CDN/banner_light.png index db04635..d5faa49 100644 Binary files a/partners/Web3CDN/banner_light.png and b/partners/Web3CDN/banner_light.png differ diff --git a/partners/chorus-one/banner_dark.png b/partners/chorus-one/banner_dark.png index 59d4cdc..6957bf2 100644 Binary files a/partners/chorus-one/banner_dark.png and b/partners/chorus-one/banner_dark.png differ diff --git a/partners/chorus-one/banner_light.png b/partners/chorus-one/banner_light.png index 7384dec..2d34a3e 100644 Binary files a/partners/chorus-one/banner_light.png and b/partners/chorus-one/banner_light.png differ diff --git a/scripts/constants.ts b/scripts/constants.ts index f776a7b..853bd24 100644 --- a/scripts/constants.ts +++ b/scripts/constants.ts @@ -15,4 +15,4 @@ export const maxNumberOfTags = 3 export const maxThumbnailWidth = 160 export const maxThumbnailHeight = 160 export const maxBannerWidth = 274 -export const maxBannerHeight = 105 +export const maxBannerHeight = 60 diff --git a/scripts/validate-partners.ts b/scripts/validate-partners.ts index 977c4cb..f534000 100644 --- a/scripts/validate-partners.ts +++ b/scripts/validate-partners.ts @@ -85,10 +85,10 @@ export async function validatePartnerInfo(partnerPath: string): Promise} - Returns a promise that resolves with an array of error messages if the image is invalid. */ -export async function checkImageDimensions(filePath: string, maxWidth = maxThumbnailWidth, maxHeight = maxThumbnailHeight): Promise { +/** + * Checks the dimensions of the partner's logo. + * + * @param {string} filePath - The file path to the image. + * @param {number} maxWidth - The maximum allowed width. + * @param {boolean} isWidthExact - Whether the width must match exactly. + * @param {number} maxHeight - The maximum allowed height. + * @param {boolean} isHeightExact - Whether the height must match exactly. + * @returns {Promise} - Returns a promise that resolves with an array of error messages if the image is invalid. + */ +export async function checkImageDimensions( + filePath: string, + maxWidth = maxThumbnailWidth, + maxHeight = maxThumbnailHeight, + isWidthExact = false, + isHeightExact = false +): Promise { const errorMessages: string[] = []; + try { const { width, height } = await sharp(filePath).metadata(); if (!width || !height) { - errorMessages.push(`image metadata could not be read for ${filePath}`); - } else if (width > maxWidth || height > maxHeight) { - errorMessages.push(`image dimensions exceed ${maxWidth}x${maxHeight} pixels`); + errorMessages.push(`Image metadata could not be read for ${filePath}`); + } else { + if (isWidthExact) { + if (width !== maxWidth) { + errorMessages.push(`Image width is ${width}px, but expected exactly ${maxWidth}px`); + } + } else { + if (width > maxWidth) { + errorMessages.push(`Image width is ${width}px, which exceeds the maximum allowed ${maxWidth}px`); + } + } + + if (isHeightExact) { + if (height !== maxHeight) { + errorMessages.push(`Image height is ${height}px, but expected exactly ${maxHeight}px`); + } + } else { + if (height > maxHeight) { + errorMessages.push(`Image height is ${height}px, which exceeds the maximum allowed ${maxHeight}px`); + } + } } } catch (error) { - errorMessages.push('Error reading image metadata'); - } finally { - return errorMessages; + errorMessages.push(`Error reading image metadata: ${(error as Error).message}`); } + + return errorMessages; } /**