feat: add Download All As dropdown for format-specific ZIP export - #15
Open
titoworlddev wants to merge 1 commit into
Open
feat: add Download All As dropdown for format-specific ZIP export#15titoworlddev wants to merge 1 commit into
titoworlddev wants to merge 1 commit into
Conversation
Add a 'Download All As' dropdown button next to 'Download All' that lets users export all optimized images in a specific format (AVIF, WebP, JPG, or JXL) inside a single ZIP archive. Also fixes the duplicate file extension bug in 'Download All' where ZIP entries were named 'foto.png.png' instead of 'foto.png'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a "Download All As" dropdown button next to the existing "Download All" button, allowing users to export all optimized images in a specific format (AVIF, WebP, JPG, JXL) inside a single ZIP archive.
Previously, the "Download All" button always exported images in their original format (with auto-optimization). If you wanted all images converted to WebP, for example, you had to download them one by one using each individual result's "Download As" dropdown.
This new dropdown follows the same pattern as the existing per-result "Download As" UI and uses the pre-generated format-specific Cloudinary URLs that were already being created during optimization.
Bug fix included
Also fixes a bug where the original "Download All" button created ZIP entries with duplicate extensions (e.g.,
foto.png.pnginstead offoto.png), because the original filename (which already contains the extension) was being passed to the archive endpoint, which then appended the format again.Changes
src/components/WidgetUpload/WidgetUpload.tsx:DOWNLOAD_FORMATSconstanthandleOnDownloadAllAs(targetFormat)function that sends format-specific URLs to the archive endpointhandleOnDownloadAllby stripping the extension from the filename before sending it to the archive endpoint