-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for creating multi-resolution stacks with upload_image.…
…py (#2411) ### What Create and upload multi-resolution stacks with `upload_image.py` Clock example screenshot updated as an example of the result obtained. Relates to #2273 TODO: - [x] pngcrush stuff? - [x] docs - [x] test with jpg as well ### Usage ```sh $ just upload --help python3 "scripts/upload_image.py" --help usage: upload_image.py [-h] [--single] [--name NAME] [--skip-pngcrush] [--debug] [path] Upload an image. positional arguments: path File path to the image. If not provided, use the clipboard's content. options: -h, --help show this help message and exit --single Upload a single image instead of creating a multi-resolution stack. --name NAME Image name (required when uploading from clipboard). --skip-pngcrush Skip PNGCrush. --debug Enable debug logging. ``` ### Example output ``` INFO:root:Base image width: 2348px INFO:root:Resizing to: 480px INFO:root:Resizing to: 768px INFO:root:Resizing to: 1024px INFO:root:Resizing to: 1200px INFO:root:pngcrush reduced size from 76341 to 71599 bytes INFO:root:Uploading 30a2659cb4f9b6ac39c808c3312a3f89b71d040c_clock_480w.png (size: 71599, type: image/png, encoding: None) INFO:root:pngcrush reduced size from 145632 to 134514 bytes INFO:root:Uploading acfb95102e353d67d0525e3a3d40fbe7f0ed638f_clock_768w.png (size: 134514, type: image/png, encoding: None) INFO:root:pngcrush reduced size from 208771 to 188959 bytes INFO:root:Uploading 7b1b0435cd8de9318c301036853d5c0d190b155f_clock_1024w.png (size: 188959, type: image/png, encoding: None) INFO:root:pngcrush reduced size from 254562 to 231188 bytes INFO:root:Uploading 51938f84bdb0df1baa1d72e09f2a1daac6e66d1c_clock_1200w.png (size: 231188, type: image/png, encoding: None) INFO:root:pngcrush reduced size from 293024 to 265268 bytes INFO:root:Uploading 4040806d866f246eda1a1434f3a1ab083764eb56_clock_full.png (size: 265268, type: image/png, encoding: None) <picture> <source media="(max-width: 480px)" srcset="https://static.rerun.io/30a2659cb4f9b6ac39c808c3312a3f89b71d040c_clock_480w.png"> <source media="(max-width: 768px)" srcset="https://static.rerun.io/acfb95102e353d67d0525e3a3d40fbe7f0ed638f_clock_768w.png"> <source media="(max-width: 1024px)" srcset="https://static.rerun.io/7b1b0435cd8de9318c301036853d5c0d190b155f_clock_1024w.png"> <source media="(max-width: 1200px)" srcset="https://static.rerun.io/51938f84bdb0df1baa1d72e09f2a1daac6e66d1c_clock_1200w.png"> <img src="https://static.rerun.io/4040806d866f246eda1a1434f3a1ab083764eb56_clock_full.png" alt=""> </picture> ``` ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [ ] I've included a screenshot or gif (if applicable) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2411 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/479fa5f/docs Examples preview: https://rerun.io/preview/479fa5f/examples <!-- pr-link-docs:end -->
- Loading branch information
Showing
3 changed files
with
276 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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