Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xcassets icon generation (correct image sizes) + stop overriding user defined assets once generated #951

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update xcassets.py
Novfensec authored Jan 2, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 0326a695b98c02c1835c2d8573c64452136f4e73
285 changes: 154 additions & 131 deletions kivy_ios/tools/external/xcassets.py
Original file line number Diff line number Diff line change
@@ -355,141 +355,142 @@
}

launchimage_json = {
"images": [
{
"extent": "full-screen",
"idiom": "iphone",
"subtype": "736h",
"filename": "Default1242x2208.png",
"minimum-system-version": "8.0",
"orientation": "portrait",
"scale": "3x",
},
{
"extent": "full-screen",
"idiom": "iphone",
"subtype": "736h",
"filename": "Default2208x1242.png",
"minimum-system-version": "8.0",
"orientation": "landscape",
"scale": "3x",
},
{
"extent": "full-screen",
"idiom": "iphone",
"subtype": "667h",
"filename": "Default750x1334.png",
"minimum-system-version": "8.0",
"orientation": "portrait",
"scale": "2x",
},
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default640x960.png",
"scale": "2x",
},
{
"extent": "full-screen",
"idiom": "iphone",
"subtype": "retina4",
"filename": "Default640x1136.png",
"minimum-system-version": "7.0",
"orientation": "portrait",
"scale": "2x",
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default768x1024.png",
"scale": "1x",
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default1024x768.png",
"scale": "1x",
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default1536x2048.png",
"scale": "2x",
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default2048x1536.png",
"scale": "2x",
},
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"filename": "Default320x480.png",
"scale": "1x",
},
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"filename": "Default640x960.png",
"scale": "2x",
},
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"filename": "Default640x1136.png",
"subtype": "retina4",
"scale": "2x",
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"filename": "Default768x1024.png",
"scale": "1x",
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"filename": "Default1024x768.png",
"scale": "1x",
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"filename": "Default1536x2048.png",
"scale": "2x",
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"filename": "Default2048x1536.png",
"scale": "2x",
},
],
"info": {
"version": 1,
"author": "xcode"
"images": [
{
"extent": "full-screen",
"idiom": "iphone",
"subtype": "736h",
"filename": "Default1242x2208.png",
"minimum-system-version": "8.0",
"orientation": "portrait",
"scale": "3x"
},
{
"extent": "full-screen",
"idiom": "iphone",
"subtype": "736h",
"filename": "Default2208x1242.png",
"minimum-system-version": "8.0",
"orientation": "landscape",
"scale": "3x"
},
{
"extent": "full-screen",
"idiom": "iphone",
"subtype": "667h",
"filename": "Default750x1334.png",
"minimum-system-version": "8.0",
"orientation": "portrait",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default640x960.png",
"scale": "2x"
},
{
"extent": "full-screen",
"idiom": "iphone",
"subtype": "retina4",
"filename": "Default640x1136.png",
"minimum-system-version": "7.0",
"orientation": "portrait",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default768x1024.png",
"scale": "1x"
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default1024x768.png",
"scale": "1x"
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default1536x2048.png",
"scale": "2x"
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"minimum-system-version": "7.0",
"filename": "Default2048x1536.png",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"filename": "Default320x480.png",
"scale": "1x"
},
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"filename": "Default640x960.png",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "iphone",
"extent": "full-screen",
"filename": "Default640x1136.png",
"subtype": "retina4",
"scale": "2x"
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"filename": "Default768x1024.png",
"scale": "1x"
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"filename": "Default1024x768.png",
"scale": "1x"
},
{
"orientation": "portrait",
"idiom": "ipad",
"extent": "full-screen",
"filename": "Default1536x2048.png",
"scale": "2x"
},
{
"orientation": "landscape",
"idiom": "ipad",
"extent": "full-screen",
"filename": "Default2048x1536.png",
"scale": "2x"
},
],
"info": {
"version": 1,
"author": "xcode"
}
}



def icon(image_xcassets, image_fn):
"""Generate all the possible Icon from a single image_fn"""
appicon_dir = join(image_xcassets, "AppIcon.appiconset")
@@ -506,101 +507,123 @@ def icon(image_xcassets, image_fn):
("87 87", None, "Icon87.png"),
("58 58", None, "Icon58.png"),
("29 29", "Icon58.png", "Icon29.png"),

# iPhone notification
# 20pt - 2x,3x
# ("40", None, "Icon40.png"),
("60 60", None, "Icon60.png"),

# iPhone
# Spotlight - iOS 7-8
# 40pt 2x,3x
("120 120", None, "Icon120.png"),
("80 80", None, "Icon80.png"),

# iPhone
# App - iOS 5,6
# 57pt 1x,2x
("114 114", None, "Icon114.png"),
("57 57", "Icon114.png", "Icon57.png"),

# iPhone
# App - iOS 7,8
# 60pt 2x,3x
("180 180", None, "Icon180.png"),
# ("120", None, "Icon120.png # duplicate"),

# iPad
# Notifications
# 20pt 1x,2x
("20 20", "Icon80.png", "Icon20.png"),
("40 40", "Icon80.png", "Icon40.png"),

# iPad
# Settings iOS 5-8
# ("58", None, "Icon58.png # duplicate"),
# ("29", "Icon58.png", "Icon29.png # duplicate"),

# iPad
# Spotlight iOS 7,8
# 40pt 1x,2x
# ("80", None, "Icon80.png # duplicate"),
# ("40", "Icon80.png", "Icon40.png" # duplicate),

# iPad
# Spotlight iOS 5,6
# 50pt 1x,2x
("100 100", None, "Icon100.png"),
("50 50", "Icon100.png", "Icon50.png"),

# iPad
# App iOS 5,6
# 72pt 1x,2x
("144 144", None, "Icon144.png"),
("72 72", "Icon144.png", "Icon72.png"),

# iPad
# App iOS 7,8
# 76pt 1x,2x
("152 152", None, "Icon152.png"),
("76 76", "Icon152.png", "Icon76.png"),

# iPad
# App iOS 9
# 83.5pt 2x
("167 167", None, "Icon167.png"),

# CarPlay
# App iOS 8
# 120pt 1x
# ("120", None, "Icon120.png # duplicate"),

# Apple Watch
# Notification Center
# 38mm, 42mm
("48 48", None, "Icon48.png"),
("55 55", None, "Icon55.png"),

# Apple Watch
# Companion Settings
# 29pt 2x,3x
# ("58", None, "Icon58.png # duplicate"),
# ("87", None, "Icon87.png # duplicate"),

# Apple Watch
# Home Screen (All)
# Long Look (38mm)
# ("80", None, "Icon80.png # duplicate"),

# Apple Watch
# Long Look (42mm)
("88 88", None, "Icon88.png"),

# Apple Watch
# Short Look
# 38mm, 42mm, 44mm
("172 172", None, "Icon172.png"),
("196 196", None, "Icon196.png"),
("216 216", None, "Icon216.png"),

# OS X
# 512pt 1x,2x
("1024 1024", None, "Icon1024.png"),
("512 512", "Icon1024.png", "Icon512.png"),

# OS X
# 256pt 1x,2x
# ("512", "Icon1024.png", "Icon512.png # duplicate"),
("256 256", "Icon512.png", "Icon256.png"),

# OS X
# 128pt 1x,2x
# ("256", "Icon512.png", "Icon256.png # duplicate"),
("128 128", "Icon256.png", "Icon128.png"),

# OS X
# 32pt 1x,2x
("64 64", "Icon128.png", "Icon64.png"),
("32 32", "Icon64.png", "Icon32.png"),

# OS X
# 16pt 1x,2x
# ("32", "Icon64.png", "Icon32.png # duplicate"),