Add build, deploy and test sources
This commit is contained in:
1 parent
b962581812
commit
3d1a08f230
259 files changed
+15273
No files matched your search
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
pip install --quiet psd-tools 2>/dev/null || pip3 install --quiet psd-tools 2>/dev/null
|
||||
python3 - <<'EOF'
|
||||
from psd_tools import PSDImage
|
||||
import os
|
||||
|
||||
files = [
|
||||
('legacy', '/path/to/pf/PSD/main/main.psd'),
|
||||
('uefi-x64', '/path/to/pf/PSD/UEFI/x64/main/main.psd'),
|
||||
('uefi-x86', '/path/to/pf/PSD/UEFI/x86/main/main.psd'),
|
||||
]
|
||||
for tag, path in files:
|
||||
print('='*70)
|
||||
print(tag, path, os.path.getsize(path), 'bytes')
|
||||
psd = PSDImage.open(path)
|
||||
print(' size:', psd.width, 'x', psd.height, 'layers:', len(list(psd.descendants())))
|
||||
for layer in psd.descendants():
|
||||
if layer.kind == 'type':
|
||||
try:
|
||||
eng = layer.engine_dict
|
||||
rd = eng.get('ResourceDict', {})
|
||||
fonts = eng.get('FontSet', [])
|
||||
fname = None
|
||||
sz = None
|
||||
for f in fonts:
|
||||
fname = f.get('Name')
|
||||
st = eng.get('StyleRun', {}).get('RunArray', [])
|
||||
for s in st:
|
||||
ss = s.get('StyleSheet', {}).get('StyleSheetData', {})
|
||||
sz = ss.get('FontSize')
|
||||
col = ss.get('FillColor', {}).get('Values')
|
||||
print(' TEXT:', repr(layer.text[:60]))
|
||||
print(' font:', fname, ' size:', sz, ' color:', col)
|
||||
print(' bbox:', layer.bbox)
|
||||
except Exception as e:
|
||||
print(' layer err:', e)
|
||||
EOF
|
||||
Reference in new issue
Block a user