From: Dietmar Maurer Date: Thu, 10 Nov 2016 15:39:35 +0000 (+0100) Subject: png-verify.pl: use Unit PixelsPerCentimeter X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=commitdiff_plain;h=9798ad65e724b5c4845964ed915c3af72a50ef25 png-verify.pl: use Unit PixelsPerCentimeter --- diff --git a/png-cleanup.pl b/png-cleanup.pl index be82c59..49c7cb4 100755 --- a/png-cleanup.pl +++ b/png-cleanup.pl @@ -12,11 +12,12 @@ my $outfile = shift || # use the following to verify image attributes # identify -verbose -# set DPI to 146, so that we can display 1024 pixels (page width) +# set PixelsPerCentimeter to 58, so that we can display 1024 +# pixels (page width) -my $dpi = 146; +my $dpcm = 58; -system("convert -units PixelsPerInch $infile -density $dpi $outfile"); +system("convert -units PixelsPerCentimeter $infile -density $dpcm $outfile"); # identify should return the same value -# system("identify -units PixelsPerInch -format '%x x %y' $outfile"); +# system("identify -units PixelsPerCentimeter -format '%x x %y' $outfile"); diff --git a/png-verify.pl b/png-verify.pl index 248f9fb..8eb6611 100755 --- a/png-verify.pl +++ b/png-verify.pl @@ -6,11 +6,11 @@ use warnings; my $infile = shift || die "no input file specified\n"; -my $dpi = 146; # expected +my $dpcm = 58; # expected -my $tmp = `identify -units PixelsPerInch -format '%x x %y' $infile`; +my $tmp = `identify -units PixelsPerCentimeter -format '%x x %y' $infile`; -die "got unexpected DPI density '$tmp' (fix with png-cleanup.pl)\n" - if $tmp ne "$dpi x $dpi"; +die "got unexpected density '$tmp' (fix with png-cleanup.pl)\n" + if $tmp ne "$dpcm x $dpcm"; exit 0;