Skip to content

Commit

Permalink
chore: small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmaynes committed Feb 10, 2024
1 parent f46cda0 commit a980fe8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion 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

Expand Down
12 changes: 5 additions & 7 deletions src/lib/image.ts
Expand Up @@ -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 {
Expand Down

0 comments on commit a980fe8

Please sign in to comment.