Separate lock screen and desktop wallpaper bases
This commit is contained in:
@@ -137,8 +137,8 @@ Describe 'Welcome wallpaper with AD metadata' {
|
||||
}
|
||||
}
|
||||
$lowerRightWhitePixels = 0
|
||||
for ($x = 1225; $x -lt 1525; $x += 2) {
|
||||
for ($y = 805; $y -lt 930; $y += 2) {
|
||||
for ($x = 1260; $x -lt 1510; $x += 2) {
|
||||
for ($y = 740; $y -lt 860; $y += 2) {
|
||||
$pixel = $bitmap.GetPixel($x, $y)
|
||||
if ($pixel.R -gt 220 -and $pixel.G -gt 220 -and $pixel.B -gt 220) {
|
||||
$lowerRightWhitePixels++
|
||||
@@ -152,4 +152,23 @@ Describe 'Welcome wallpaper with AD metadata' {
|
||||
$bitmap.Dispose()
|
||||
}
|
||||
}
|
||||
|
||||
It 'keeps the lock screen base free of the desktop logo' {
|
||||
$bitmap = [Drawing.Bitmap]::FromFile((Join-Path $repositoryRoot 'assets\branding\darkblue-lockscreen.jpg'))
|
||||
try {
|
||||
$whitePixels = 0
|
||||
for ($x = 0; $x -lt $bitmap.Width; $x += 4) {
|
||||
for ($y = 0; $y -lt $bitmap.Height; $y += 4) {
|
||||
$pixel = $bitmap.GetPixel($x, $y)
|
||||
if ($pixel.R -gt 220 -and $pixel.G -gt 220 -and $pixel.B -gt 220) {
|
||||
$whitePixels++
|
||||
}
|
||||
}
|
||||
}
|
||||
($whitePixels -lt 10) | Should Be $true
|
||||
}
|
||||
finally {
|
||||
$bitmap.Dispose()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user