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

Task: API for saving images #1206

Closed
Tracked by #1707
letsintegreat opened this issue Apr 5, 2023 · 17 comments · Fixed by #1725
Closed
Tracked by #1707

Task: API for saving images #1206

letsintegreat opened this issue Apr 5, 2023 · 17 comments · Fixed by #1725
Labels

Comments

@letsintegreat
Copy link
Contributor

letsintegreat commented Apr 5, 2023

In order to implement the insert image feature in description formatting, create an API which will accept an image and return its URL.

image

@Yashsomalkar
Copy link

But we are already having a select image functionality, right ?

@letsintegreat
Copy link
Contributor Author

But we are already having a select image functionality, right ?

As we have now introduced GFM, it gives users the ability to insert images right into the description. So, they can decide on the location of the image in the text, which was not possible before.

The functionality will be similar to GitHub's markdown, when an image is inserted, it is sent to the backend, and the image is embedded via its URL, like this -

![ALT_TEXT](URL)

@Yashsomalkar
Copy link

But we are already having a select image functionality, right ?

As we have now introduced GFM, it gives users the ability to insert images right into the description. So, they can decide on the location of the image in the text, which was not possible before.

The functionality will be similar to GitHub's markdown, when an image is inserted, it is sent to the backend, and the image is embedded via its URL, like this -

![ALT_TEXT](URL)

Ahh awesome

@AtmegaBuzz
Copy link
Collaborator

AtmegaBuzz commented Apr 5, 2023

@letsintegreat best is create a form data and send images with it, in backend you can make description as RichTextField or any other field which supports markdown characters and then, then create a view with formdata parser to accept the api request in form format, this way you dont have to create another api just for saving images.

Remember this will require change in model, web and app are using same model. let's have a small meet so that we migrate both web and app at same time

@letsintegreat
Copy link
Contributor Author

let's have a small meet so that we migrate both web and app at same time

Alright, I'd reach out to you on Slack for setting up the meeting, thanks!

@letsintegreat
Copy link
Contributor Author

letsintegreat commented Apr 6, 2023

@fredfalcon - @AtmegaBuzz and I just had a meeting to discuss how can a user upload an image and display it in the middle of an issue description.

Our first approach was the standard approach used by GitHub and Stack Overflow. Paste an image in the description field, that image will be uploaded to the server and its URL will be embedded in the description via markdown. But the problem with this is that, after pasting an image, the user may choose not to complete the issue report (or the issue is deleted in the future), in that case the uploaded image will keep using resources in our server for no reason.

After a few more rejected approaches, this is what we came up with finally - Let's say the user has upload 5 screenshots, then they can embed those screenshots with a special syntax, let's say $1 and $3. In this way first and third screenshots will be rendered in between the description as specified by the user, and the rest of the screenshots will be rendered, as usual, under the screenshots heading.

What are your views on this? Should we start working on it?

@fredfalcon
Copy link
Contributor

sounds like a good efficient solution maybe [img1] [img2] or something

@AtmegaBuzz
Copy link
Collaborator

AtmegaBuzz commented Apr 6, 2023

cool then lets go with $ [img1] $ [img2] or [img1] [img2], cause $3 can be used to mention currency by the reporter

@Atharva-Kanherkar
Copy link

Can i start working on this issue?

@DonnieBLT
Copy link
Collaborator

You can self assign by typing / assign (together)

@Atharva-Kanherkar
Copy link

/assign

@nick2432
Copy link

/assign

Copy link
Contributor

You are already assigned to another open issue, please wait until until it's closed or remove your assignment to get assigned to this issue.

@kr-2003
Copy link
Contributor

kr-2003 commented Jan 29, 2024

@DonnieBLT
I want to work upon this issue. I just want to ask that BLT stores media files in /media folder directly into the server, right?
So, the api should return the local path of the image from /media folder, when uploaded, and not from any cloud storage like S3.

@kr-2003 kr-2003 removed their assignment Jan 29, 2024
@kr-2003
Copy link
Contributor

kr-2003 commented Jan 29, 2024

cool then lets go with $ [img1] $ [img2] or [img1] [img2], cause $3 can be used to mention currency by the reporter

@DonnieBLT I am gonna go with this approach.

@DonnieBLT
Copy link
Collaborator

Sounds good

kr-2003 added a commit to kr-2003/BLT that referenced this issue Jan 29, 2024
kr-2003 added a commit to kr-2003/BLT that referenced this issue Jan 29, 2024
@kr-2003
Copy link
Contributor

kr-2003 commented Jan 29, 2024

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants