-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: shrink 17-artwork-multimodal import size #42
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ import { fromPairs, defaults } from "lodash" | |
* | ||
* https://drive.google.com/drive/u/1/folders/1Lh7msUc0R_JlpNEzApZ4YbqB8x5tbpws | ||
*/ | ||
export async function getArtworks() { | ||
const filePath = path.join(__dirname, "./data/artworks.json") | ||
export async function getArtworks(filename: string) { | ||
const filePath = path.join(__dirname, `./data/${filename}`) | ||
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Maybe a filename could be optional here? Also this method is being used here. |
||
const data = await fs.promises.readFile(filePath, "utf-8") | ||
const artworks: GravityArtwork[] = JSON.parse(data) | ||
return artworks | ||
|
@@ -60,8 +60,8 @@ export function resizeImage( | |
height: number | ||
} | ||
) { | ||
const { width, height } = defaults(options, { width: 500, height: 500 }) | ||
return `https://d7hftxdivxxvm.cloudfront.net/?src=${src}&resize_to=fit&width=${width}&height=${height}&grow=false` | ||
const { width, height } = defaults(options, { width: 224, height: 224 }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the default resolution configured in the |
||
return `https://d7hftxdivxxvm.cloudfront.net/?src=${src}&resize_to=fit&width=${width}&height=${height}&grow=false&quality=75` | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egdbear - decided to insert them into the same
collection
with a flag.