Files

17 lines
694 B
Python

#!/usr/bin/env python3
from psd_tools import PSDImage
import sys
for p in sys.argv[1:]:
print('=' * 20, p.split('/')[-1])
psd = PSDImage.open(p)
for layer in psd:
print(' group %-30s vis=%s bbox=%s' % ((layer.name or '')[:30], layer.visible, layer.bbox))
for ch in layer:
if ch.kind == 'type':
print(' type %-32s vis=%s bbox=%s' % ((ch.name or '')[:32], ch.visible, ch.bbox))
elif ch.kind == 'pixel':
print(' pixel %-32s vis=%s bbox=%s' % ((ch.name or '')[:32], ch.visible, ch.bbox))
else:
print(' %-6s %-32s vis=%s' % (ch.kind, (ch.name or '')[:32], ch.visible))