-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Image field type #5396
Image field type #5396
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/EAeRVwNp9Cs7CBkGCM6nDQWAJtwK |
🦋 Changeset detectedLatest commit: ec3a1e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ec3a1e2:
|
Given we only need to get the type and size of the iamge, could we replace sharp with https://www.npmjs.com/package/file-type + https://www.npmjs.com/package/image-size? There is one problem with that which is svg support which kinda makes things weird but we might just want to avoid supporting svg for now given it's not a binary format so it's kinda totally different to the others and doesn't(at least in my understanding) have a defined width and height in the way the other formats we have do. I'd like to avoid a dependency on a native module like sharp in keystone if we can avoid it. |
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.
Can you(@rohan-deshpande and/or @gwyneplaine) resolve the conflicts, add changesets, convert the Implementation to TypeScript like the other fields now are and originally the plan was to store the data in seperate columns rather than JSON, do we want to do that now?
Co-authored-by: Mitchell Hamilton <[email protected]>
445b080
to
73d7da5
Compare
Added
Notes
sharp
API.getDataFromStream
then it probably makes sense for the file to get written to the storage layer within this function. If that's the case, then we should change the name of the function to something likewriteStreamToFile
upload
key in the config. While I am also not a fan ofmode
as it is just super generic, I feel it's easier to document thanupload
so I would be in favour of changing this key tomode
. We at least wouldn't have to do something like this since we are calling itmode
in every other instance