mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-30 14:11:21 +00:00
desktopToDarwinBundle: Drop 48x48 size
On macOS 10.13 the 48x48 icon size is not supported. It results in a corrupted image being displayed. I suspect the image data is being truncated to what it expects for 32x32 or maybe data is read for 128x128, which would be a buffer overflow.
This commit is contained in:
parent
7a40437bdd
commit
21fe5d3b8b
@ -18,7 +18,9 @@ convertIconTheme() {
|
||||
local -r iconName=$3
|
||||
local -r theme=${4:-hicolor}
|
||||
|
||||
local -ra iconSizes=(16 32 48 128 256 512)
|
||||
# Sizes based on archived Apple documentation:
|
||||
# https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/app-icon#app-icon-sizes
|
||||
local -ra iconSizes=(16 32 128 256 512)
|
||||
local -ra scales=([1]="" [2]="@2")
|
||||
|
||||
# Based loosely on the algorithm at:
|
||||
@ -31,13 +33,6 @@ convertIconTheme() {
|
||||
local scaleSuffix=${scales[$scale]}
|
||||
local exactSize=${iconSize}x${iconSize}${scaleSuffix}
|
||||
|
||||
if [[ $exactSize = '48x48@2' ]]; then
|
||||
# macOS does not support a 2x scale variant of 48x48 icons
|
||||
# See: https://en.wikipedia.org/wiki/Apple_Icon_Image_format#Icon_types
|
||||
echo "unsupported"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local -a validSizes=(
|
||||
${exactSize}
|
||||
$((iconSize + 1))x$((iconSize + 1))${scaleSuffix}
|
||||
|
Loading…
Reference in New Issue
Block a user