forked from spyder-ide/spyder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpng-convert-and-optimize.sh
More file actions
executable file
·21 lines (19 loc) · 969 Bytes
/
Copy pathpng-convert-and-optimize.sh
File metadata and controls
executable file
·21 lines (19 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#
# Small script to use ImageMagick on all png files to make sure the png
# format is correct, and to avoid lipng warnings like:
# libpng warning: iCCP: known incorrect sRGB profile
# For more information, see PR 2216:
# https://github.com/spyder-ide/spyder/pull/2216
# and this soluation is based on:
# https://stackoverflow.com/questions/22745076/libpng-warning-iccp-known-incorrect-srgb-profile
# https://tex.stackexchange.com/questions/125612/warning-pdflatex-libpng-warning-iccp-known-incorrect-srgb-profile
#
# make sure to run this from the top level spyder repo dir in order to catch
# all the png files
echo "Searching recursively for all png files in:" `pwd`
# fix all png files in the current directory (and sub-dirs) using ImageMagick:
find . -type f -name "*.png" -exec convert {} -strip {} \;
# optimize all images, can hold a 20-30% size reduction on avarage, no loss of
# image quality
find . -type f -name "*.png" -exec optipng -o7 {} \;