adapted imagemagick compare metric to match github action runnr

master
Martin Scheidt 2022-02-10 15:22:38 +01:00
parent 546c2da7ca
commit 5c38af9a3f
2 changed files with 21 additions and 3 deletions

View File

@ -23,8 +23,8 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: "update runner" - name: "change ImageMagick policy to allow pdf->png conversion"
run: sudo apt-get update -y && sudo apt-get upgrade -y imagemagick run: sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
# ## # ##
# - name: "setup TeX Live (via apt-get)" # - name: "setup TeX Live (via apt-get)"

View File

@ -93,6 +93,21 @@ else
fi fi
## -- doing the tests ## -- doing the tests
#
# compare metrics
#
# AE: absolute error count, number of different pixels (-fuzz affected)
# DSSIM: structural dissimilarity index
# FUZZ: mean color distance
# MAE: mean absolute error (normalized), average channel error distance
# MEPP: mean error per pixel (normalized mean error, normalized peak error)
# MSE: mean error squared, average of the channel error squared
# NCC: normalized cross correlation
# PAE: peak absolute (normalized peak absolute)
# PHASH: perceptual hash for the sRGB and HCLp colorspaces.
# PSNR: peak signal to noise ratio
# RMSE: root mean squared (normalized root mean squared)
# SSIM: structural similarity index
mkdir -p .testing mkdir -p .testing
@ -109,7 +124,10 @@ for TEST in `ls $TESTDIR/*.tex`; do
echo $n "'$NAME' test: $c" echo $n "'$NAME' test: $c"
fi fi
pdflatex -output-directory=.testing -interaction=batchmode -halt-on-error $FILE 2>&1 > /dev/null pdflatex -output-directory=.testing -interaction=batchmode -halt-on-error $FILE 2>&1 > /dev/null
compare -metric DSSIM -colorspace RGB .testing/${NAME}.pdf ${NAME}_expected.pdf NULL: if [ $verbose = 1 ]; then
echo $n "build complete, $c" # it is actually not in percent! But it helps them humans...
fi
compare -metric RMSE -colorspace RGB .testing/${NAME}.pdf ${NAME}_expected.pdf NULL:
if [ $verbose = 1 ]; then if [ $verbose = 1 ]; then
echo "% difference." # it is actually not in percent! But it helps them humans... echo "% difference." # it is actually not in percent! But it helps them humans...
fi fi