X-Git-Url: https://git.proxmox.com/?p=pve-docs.git;a=blobdiff_plain;f=png-verify.pl;h=d345ff61ab5eaebeede2ce919a39fed499243269;hp=248f9fb482ba84f3a0f10d9f683a5bb8d6f3a2fe;hb=90682f35982513fdecf9109cd15235fa982413fc;hpb=f250356fdf56d6f43aa44c4abfe869c48b622ae5 diff --git a/png-verify.pl b/png-verify.pl index 248f9fb..d345ff6 100755 --- a/png-verify.pl +++ b/png-verify.pl @@ -2,15 +2,27 @@ use strict; use warnings; +use File::Basename; + +my $installer_images = { + 'pve-grub-menu.png' => 1, + 'pve-installation.png' => 1, + 'pve-select-location.png' => 1, + 'pve-select-target-disk.png' => 1, + 'pve-set-password.png' => 1, + 'pve-setup-network.png' => 1, +}; my $infile = shift || die "no input file specified\n"; -my $dpi = 146; # expected +my $basename = basename($infile); + +my $dpcm = $installer_images->{$basename} ? 72 : 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 "$infile: got unexpected density '$tmp' (fix with png-cleanup.pl)\n" + if $tmp ne "$dpcm x $dpcm"; exit 0;