5
0
mirror of git://git.proxmox.com/git/pve-docs.git synced 2025-03-19 18:50:06 +03:00

add tools to verify/set DPI densite

This is important if we render images with dblatex/pdftex
This commit is contained in:
Dietmar Maurer 2016-11-07 13:47:34 +01:00
parent 7515acaff5
commit f250356fdf
4 changed files with 39 additions and 1 deletions

View File

@ -144,7 +144,7 @@ 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 102 KiB

22
png-cleanup.pl Executable file
View File

@ -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");

16
png-verify.pl Executable file
View File

@ -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;