11

How do I get images from iTunes.rsrc using DeRez? I just want png or standard image files. Thanks.

1
  • 2
    +1 and favorited. I could really utilize this as well. Oct 25, 2011 at 23:29

1 Answer 1

11

This worked:

DeRez -only 'PNG ' /Applications/iTunes.app/Contents/Resources/Images.rsrc -useDF > iTunes.png

Then run this script in Python 2.x (I tried using the bits between the /* ... */ to avoid decoding, but it didn't work).

for l in file('iTunes.png'):
    if not l[0] == '\t':
        if l.startswith('data '):
            res_id = l[l.rindex('(') + 1:l.rindex(')')]
            out = file(res_id + '.png', 'wb')
        continue
    out.write(l[l.index('"') + 1:l.index('" ')].replace(' ', '').decode('hex'))

You should get one PNG file per resource ID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.