Re: [Tutor] Extracting a PNG Image File from a Binary File..

2005-01-03 Thread Kent Johnson
Looking at your data, the header is at offset 0x60, not 0x50. If I use infile.seek(0x60) it works fine. Kent Aaron Elbaz wrote: Hi, My question is sort of on the difficult side, but I promise I'm a newb ;) So maybe it isn't.. Frederick Lundh himself gave me this chunk of code..and I can't get it

Re: [Tutor] Extracting a PNG Image File from a Binary File..

2005-01-03 Thread Alan Gauld
> # if header != "\211PNG\r\n\032\n": > # raise IOError("not a valid PNG file") > # outfile.write(header) > > It returns the IO error when I try it on this and other files: > http://simcitysphere.com/peachville.sc4 If you are sure the file is OK then it looks like the signature definit

[Tutor] Extracting a PNG Image File from a Binary File..

2005-01-03 Thread Aaron Elbaz
Hi, My question is sort of on the difficult side, but I promise I'm a newb ;) So maybe it isn't.. Frederick Lundh himself gave me this chunk of code..and I can't get it to work. I was hoping someone could spot the error. The goal is to extract a png image file from a binary simcity 4 file. #imp