设计完成30%
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$asset = Join-Path $root 'static/assets/modules/auth/opaque/a02-login-panel.png'
|
||||
|
||||
if (-not (Test-Path -LiteralPath $asset)) {
|
||||
throw 'Missing A02 login-panel asset'
|
||||
}
|
||||
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
$bitmap = [System.Drawing.Bitmap]::FromFile($asset)
|
||||
$width = [int]$bitmap.Width
|
||||
$height = [int]$bitmap.Height
|
||||
$corners = @(
|
||||
$bitmap.GetPixel(0, 0).A,
|
||||
$bitmap.GetPixel(($width - 1), 0).A,
|
||||
$bitmap.GetPixel(0, ($height - 1)).A,
|
||||
$bitmap.GetPixel(($width - 1), ($height - 1)).A
|
||||
)
|
||||
$bitmap.Dispose()
|
||||
|
||||
$ratio = [double]$width / $height
|
||||
if ($width -ne 940 -or $height -ne 1672) { throw 'A02 login-panel asset must remain 940 x 1672px.' }
|
||||
if ([Math]::Abs($ratio - 0.5622) -gt 0.001) { throw 'A02 login-panel asset must retain its approved panel ratio.' }
|
||||
if (($corners | Where-Object { $_ -ne 255 }).Count -ne 0) { throw 'A02 login-panel asset must have opaque outer corners.' }
|
||||
|
||||
Write-Output 'A02-ASSET-ALPHA-AUDIT PASS'
|
||||
Reference in New Issue
Block a user