]> git.proxmox.com Git - pve-docs.git/commitdiff
add tools to verify/set DPI densite
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 7 Nov 2016 12:47:34 +0000 (13:47 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 7 Nov 2016 13:08:32 +0000 (14:08 +0100)
This is important if we render images with dblatex/pdftex

Makefile
images/screenshot/gui-datacenter-search.png
png-cleanup.pl [new file with mode: 0755]
png-verify.pl [new file with mode: 0755]

index 5e513421f9894fa04ddb1d764427422a817cef71..527b72cf02415a07ba796a89ac9e4a5c23a88c77 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -144,7 +144,7 @@ deb:
        rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
        make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
 
        rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
        make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
 
-${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import asciidoc/mediawiki.conf
+${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import asciidoc/mediawiki.conf verify-images
        rm -rf build
        mkdir build
        rsync -a debian/ build/debian
        rm -rf build
        mkdir build
        rsync -a debian/ build/debian
index 4fbedcfd71b42b1be1c861dfa47f8a812ca60f44..4bba14793e3b85eda4cf2250e4c6065d4d5488e3 100644 (file)
Binary files a/images/screenshot/gui-datacenter-search.png and b/images/screenshot/gui-datacenter-search.png differ
diff --git a/png-cleanup.pl b/png-cleanup.pl
new file mode 100755 (executable)
index 0000000..be82c59
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $infile = shift ||
+    die "no input file specified\n";
+
+my $outfile = shift ||
+    die "no outpu file specified\n";
+
+# use the following to verify image attributes
+# identify -verbose <filename>
+
+# set DPI to 146, so that we can display 1024 pixels (page width)
+
+my $dpi = 146;
+
+system("convert -units PixelsPerInch $infile -density $dpi $outfile");
+
+# identify should return the same value
+# system("identify -units PixelsPerInch -format '%x x %y' $outfile");
diff --git a/png-verify.pl b/png-verify.pl
new file mode 100755 (executable)
index 0000000..248f9fb
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $infile = shift ||
+    die "no input file specified\n";
+
+my $dpi = 146; # expected
+
+my $tmp = `identify -units PixelsPerInch -format '%x x %y' $infile`;
+
+die "got unexpected DPI density '$tmp' (fix with png-cleanup.pl)\n"
+    if $tmp ne "$dpi x $dpi";
+
+exit 0;