From 989c0edd3d661cd783d7688d75f6d109fc526add Mon Sep 17 00:00:00 2001 From: dodo Date: Sun, 31 Mar 2013 17:05:10 +0200 Subject: [PATCH] [PATCH 8/8] add script to print image information found in xml files image widths shouldnot exceed 600px. if you consider to add an image to the git with width bigger than 600px, i recommend that you should think about either to add a thumbnail image manually or if you extend this script to filter all images to get only images with widths > 600px to convert them in the makefile and to pass the filenames to xsltproc via stringparam and parse the list there to prepare image src with the according thumbnailurl (in xsl/common.xsl line 56 atm). Signed-off-by: klObs --- scripts/image_size.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 scripts/image_size.sh diff --git a/scripts/image_size.sh b/scripts/image_size.sh new file mode 100755 index 000000000..24f6d0a78 --- /dev/null +++ b/scripts/image_size.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e + +for i in `ls ./content/news/*.xml` +do + xmllint --shell <<<'cat //image[not(starts-with(text(), "http"))]/text()' "$i" \ + | sed '/^\/\? [>-]/d' \ + | awk '{ print "./content/static/images/" $1 }' \ + | xargs identify -quiet 2> /dev/null || true +done +