Compress Images for Status Screen and Add Image Compression Script (#21300)
This commit is contained in:
parent
0f20f07363
commit
4bf8aaf2e0
|
@ -33,7 +33,7 @@
|
|||
|
||||
## Misc
|
||||
|
||||
- [Importing icons from Figma into project](export-icons.md)
|
||||
- [Importing assets from Figma into project](import-assets.md)
|
||||
- [Updating Status APK builds for the F-Droid Android application catalogue](fdroid.md)
|
||||
- [Troubleshooting for known errors](troubleshooting.md)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# new icons
|
||||
# Importing assets from Figma into project
|
||||
|
||||
## Export icons
|
||||
## Icons
|
||||
|
||||
![](images/export-icons/export-icons.gif)
|
||||
|
||||
|
@ -13,3 +13,11 @@
|
|||
```
|
||||
2x@2x
|
||||
4. If you want platform specific icon use `.android` or `.ios` suffixes. Example `icon_name@2x.android.png`.:w
|
||||
|
||||
## Images
|
||||
|
||||
Make sure to compress images before using into project.
|
||||
```
|
||||
make shell
|
||||
./scrips/compress_image.sh image_path
|
||||
```
|
|
@ -24,6 +24,8 @@ in mkShell {
|
|||
clojure maven watchman
|
||||
# other nice to have stuff
|
||||
yarn nodejs python310 maestro
|
||||
# Required for /scripts/compress_image.sh script
|
||||
imagemagick
|
||||
] # and some special cases
|
||||
++ lib.optionals stdenv.isDarwin ([ cocoapods clang tcl idb-companion ] ++ appleSDKFrameworks)
|
||||
++ lib.optionals (!stdenv.isDarwin) [ gcc8 ]
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 722 KiB After Width: | Height: | Size: 195 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 345 KiB |
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 <input_image.png>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
input_file="$1"
|
||||
backup_file="${input_file%.png}.bak.png"
|
||||
output_file="$input_file"
|
||||
|
||||
cp "$input_file" "$backup_file"
|
||||
|
||||
magick "$input_file" -quality 100 -define png:compression-level=9 -strip -colors 256 "$output_file"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Image compression completed: $input_file"
|
||||
echo "Backup created: $backup_file"
|
||||
else
|
||||
mv "$backup_file" "$input_file"
|
||||
echo "Error during image compression"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue