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

Support uploading images #29

Open
alessandro308 opened this issue Mar 15, 2022 · 4 comments
Open

Support uploading images #29

alessandro308 opened this issue Mar 15, 2022 · 4 comments

Comments

@alessandro308
Copy link

I mean, is there some technical stuff I should take care if I remove the limit on the file type in the uploader component?

@MaxLeiter
Copy link
Owner

No, there’s no real technical reason except showing them in the preview rendered. It probably makes most sense to do what GH does and upload images into Markdown and just provide a link, but file hosting (rather than just text) is out of scope for this project imo.

@adyanth
Copy link

adyanth commented Mar 28, 2022

Would converting the image to SVG and embedding it in the file be within scope?

@MaxLeiter
Copy link
Owner

Probably not, because I feel like the SVGs could be huge compared to the actual image file?

after some thought, I think I am okay with supporting hosting images, but it would require a bit of work. I guess we could embed the image in sqlite, but its probably better to store it as-is and serve it from the folder location on disk. @adyanth any thoughts on this? I appreciate your input 🙏

@adyanth
Copy link

adyanth commented Mar 28, 2022

The size would be large when using SVG.

I haven't seen any pros/cons on storing images in the DB vs the filesystem to comment on which would be better.

Storing images in a filesystem path (configurable) is good enough which may (in the future if needed) allow something like nginx serve the bulk static content if necessary. Even cache the content if needed.

I would recommend having a separate endpoint for these content. Also, similar to how GitHub does it, would be better to generate a random filename (and strip metadata) for the images before saving it.

@MaxLeiter MaxLeiter changed the title Why the needs to avoid to upload images instead of plain text? Support uploading images Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants