Skip to content

Feat/issue105/download all sequence images#175

Open
Yoctoboy wants to merge 2 commits intomainfrom
feat/issue105/download_all_sequence_images
Open

Feat/issue105/download all sequence images#175
Yoctoboy wants to merge 2 commits intomainfrom
feat/issue105/download_all_sequence_images

Conversation

@Yoctoboy
Copy link
Copy Markdown
Collaborator

@Yoctoboy Yoctoboy commented Feb 1, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
new-pyro-platform Ready Ready Preview, Comment Apr 7, 2026 2:40pm

Comment thread package.json
"axios": "^1.11.0",
"i18next": "^25.3.4",
"i18next-browser-languagedetector": "^8.2.0",
"jszip": "^3.10.1",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not really fond of generating zip on the frontend side. I would rather have in the backend. Maybe we can see with the delivery planning

Copy link
Copy Markdown
Member

@fe51 fe51 left a comment

Choose a reason for hiding this comment

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

Hi Alexis, thanks a lot for the PR !

First, It does not work for me using a Mac. With Chrome and Firefix its fails to download (It work 1 image as before) but not the zip.
It seems I get a CORS Error (see screenshot)

Image

What do you need from me to help you fix whats could be wrong in my case ?
(running the project locally on your branch, connected to the production alerapi)

About 2 folders structure -> The solution you provide force windows user to use 7zip is that right ? Also, you are saying, it could work on Windows to have only one folder with all images (bboxes or not) without having to use 7zip ? According to your response, this leads us to at least a few strategies

  • if 7zip is not necessary for 1 folder: could have 3 options associated with the download button arrow: current images, all images, all images with bbox
  • Otherwise, we could consider testing with subfolders and 7zip needed and see how users behave/reacts (as long as I am not sure how often this feature will be used).

Happy to discuss it

@Yoctoboy Yoctoboy force-pushed the feat/issue105/download_all_sequence_images branch from 03159dc to 1ac46d5 Compare April 7, 2026 14:07
… zip, or all images with bounding boxes in zip)
@Yoctoboy Yoctoboy force-pushed the feat/issue105/download_all_sequence_images branch from 1ac46d5 to a1b4e14 Compare April 7, 2026 14:38
@Yoctoboy
Copy link
Copy Markdown
Collaborator Author

Yoctoboy commented Apr 7, 2026

Hi @fe51 👋

I made the requested changes.

I also investigated those CORS errors your are getting. I assume you got them while not testing on your local machine. If that's indeed the case, here's the reason the zip download feature may fail on deployed environments:

  • When displaying an image with <img>, the browser just downloads the image from the URL and it works fine even if the response does not contain CORS-related headers (like Access-Control-Allow-Origin). The browser does not check for such headers when displaying an image in an <img> tag, probably because it just isn't dangerous, it's just displaying an image and not executing anything special.
  • For the download as zip feature, the image is first downloaded by the frontend, then zipped. This means the image is not rendered in a simple <img> tag, but actually fetched normally by the browser. That needs CORS headers, otherwiser the browser may block it.

If the images are hosted on S3, the only thing to do I can think of is to tell S3 to return the images with Access-Control-Allow-Origin: <actual pyronear url> header, and it should work. We can discuss that tomorrow :)

@Yoctoboy Yoctoboy changed the title [DRAFT] Feat/issue105/download all sequence images Feat/issue105/download all sequence images Apr 8, 2026
Copy link
Copy Markdown
Member

@fe51 fe51 left a comment

Choose a reason for hiding this comment

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

HI @Yoctoboy, thank you for the udpates !

Tested local this time no CORS issue !

Functional test is good for me if you just add camera name in file export in order to help firefighters.
Also, wondering, could it be an issue to have some /in file path ? delete or replace by a _?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[DOWNLOAD] As a user on the Alerts page, I want to download image of all detections

3 participants