diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2d30933 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.png diff=image diff --git a/README.md b/README.md index 1fd5249..52c7d21 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ A repository for golden image files that are used by tests in https://github.com/flutter/flutter. See: https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package%3Aflutter + +## Getting diffs for golden images + +If you have ImageMagick and you want to use it to show diffs of files +in this repo, add the following to your `~/.gitconfig`: + +``` +[diff "image"] + command = /path/to/this/repo/diff-images.sh +``` diff --git a/diff-images.sh b/diff-images.sh new file mode 100755 index 0000000..24135da --- /dev/null +++ b/diff-images.sh @@ -0,0 +1,2 @@ +#!/bin/sh +compare $2 $1 png:- | montage -geometry +4+4 $2 - $1 png:- | display -title "$1" -