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

BUG: Observations sometimes don't link the image properly #21

Open
sophearahsp opened this issue Nov 25, 2024 · 2 comments
Open

BUG: Observations sometimes don't link the image properly #21

sophearahsp opened this issue Nov 25, 2024 · 2 comments

Comments

@sophearahsp
Copy link
Contributor

Repro steps

  1. Create capture with https://www.twitch.tv/alveussanctuary/clip/FastDrabBatteryKappa-Asg7k_HsCYP9IPnd?filter=clips&range=24hr&sort=time
  2. Create observation around reed
Screenshot 2024-11-25 at 9 37 46 AM 3. Image doesn't link properly as seen here Screenshot 2024-11-25 at 9 40 26 AM

The image src is http://localhost:2209/extract_436_-74_553_553/http://127.0.0.1:10000/devstoreaccount1/azurite/594ac6aa-09bb-454a-a101-9eba342ddb70.png, and has a negative extract y value for some reason. If you edit the src to 0 or a positive number, an image appears again. Simple workaround would be to set the link using the absolute value of all the extraction options but it might not crop nicely.

After experimenting with it for a bit, I think making bigger observations tend to have this problem?

@changesbyjames
Copy link
Collaborator

changesbyjames commented Nov 26, 2024

hey @sophearahsp, thank you for the bug!

this could be happening in two places:

  • when making a bounding box and creating an observation, it's being calculated and saved incorrectly to the database. If you could check the numbers you're getting in the database/in the API response and see negative numbers, it's probably happening here. I would be surprised because there are explicit checks for that sort of thing.
  • in the <Polaroid /> component we use the <Square /> component that attempts to change the extract parameters to make the selection into a square without cropping any of it out.

for example, this is when it works well:
image

in your case, i think this is what's happening:
image

I'm not really sure what the fix is here. I would still like to have it be a square but I don't know what's the best way to get there would be without cutting off the bounding box area?

maybe something like this where the ideal square is calculated and then it's shifted inwards?
image

@sophearahsp
Copy link
Contributor Author

Hi @changesbyjames! your idea about the <Square /> was the problem. I ended up just doing your suggested fix in #23.

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

No branches or pull requests

2 participants