Skip to content
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

Add more image info to DB #148

Merged
merged 16 commits into from
Jul 17, 2022
Merged

Add more image info to DB #148

merged 16 commits into from
Jul 17, 2022

Conversation

SaraVieira
Copy link
Contributor

@SaraVieira SaraVieira commented Jul 16, 2022

Related to #37

Adds:

  • File size
  • Format
  • Width
  • Height

@vercel
Copy link

vercel bot commented Jul 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
webstudio-designer ✅ Ready (Inspect) Visit Preview Jul 17, 2022 at 7:34PM (UTC)

Copy link
Member

@kof kof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first round done

@SaraVieira
Copy link
Contributor Author

weird I have no errors locally

@SaraVieira
Copy link
Contributor Author

Fixed by making sure we run generate on prisma

@SaraVieira
Copy link
Contributor Author

turns out I didn't know zod remove the parts of the object that I didn't declare on the types and that's why I didn't have access to the size and function to turn the file into an array buffer

@SaraVieira SaraVieira requested a review from kof July 16, 2022 20:31
@SaraVieira
Copy link
Contributor Author

We will not be downloading the image anymore, i send the array buffer over

@SaraVieira SaraVieira mentioned this pull request Jul 16, 2022
7 tasks
@kof
Copy link
Member

kof commented Jul 17, 2022

  • bug: click on upload button > select image > upload > click on upload button > it has already uploaded the last image again

@kof
Copy link
Member

kof commented Jul 17, 2022

  • sort order - last uploaded image should come first

@kof
Copy link
Member

kof commented Jul 17, 2022

  • did some primitive benchmarking of sharp calls, it gets meta data of an image (3mb) 1000 times within 200ms (m1 max), then I tried to do the same with a 200kb image, perf is similar, that tells me they really only read a few bytes. So this is really fast, I am happy.

Copy link
Member

@kof kof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 see a few todos

@kof
Copy link
Member

kof commented Jul 17, 2022

Fixed by making sure we run generate on prisma

it needed prisma migrate, which we currently don't run automatically, not sure what's the best practice when to run it

@SaraVieira
Copy link
Contributor Author

Can this be merged?

@SaraVieira SaraVieira merged commit 8c1c6dc into main Jul 17, 2022
@SaraVieira SaraVieira deleted the more.image-info branch July 17, 2022 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants