diff --git a/README.md b/README.md index afe3516..e79ace4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # image-analyzer-app -> a NextJS app that allows users to analyze images using MobileNet (via TensorflowJS), image descriptions from ChatGPT, and hosted on Cloudflare Pages +> a NextJS app for analyzing images using MobileNet (via TensorflowJS). Image descriptions generated from ChatGPT and hosted on Cloudflare Pages. ## Requirements diff --git a/src/lib/image.ts b/src/lib/image.ts index 4e5034a..0abfde2 100644 --- a/src/lib/image.ts +++ b/src/lib/image.ts @@ -8,13 +8,11 @@ export const resizeImage = ({ imageHeight: number maxWidth: number maxHeight: number -}) => { - if (imageWidth > imageHeight) { - if (imageWidth > maxWidth) { - return { - width: maxWidth, - height: imageHeight * (maxWidth / imageWidth), - } +}): { width: number; height: number } => { + if (imageWidth > imageHeight && imageWidth > maxWidth) { + return { + width: maxWidth, + height: imageHeight * (maxWidth / imageWidth), } } else if (imageHeight > maxHeight) { return {