flamesrock wrote:
[snip]
[EMAIL PROTECTED]:~/score$ python sc4png.py Traceback (most recent call last): File "sc4png.py", line 26, in ? pngcopy(infile, outfile) File "sc4png.py", line 14, in pngcopy size, cid = struct.unpack("!l4s", chunk) struct.error: unpack str size does not match format
Any ideas on how to fix it? If I understand this page correctly, http://www.python.org/doc/current/lib/module-struct.html a png is basically a 'big endian string of 14 chars'? Changing it to !14b" gives a"ValueError: unpack tuple of wrong size" -thanks in advance for any help
No, the chunk header is specified as "!l4s" where that second character is a lower-case "L", not one "1". The struct is "a 4-byte long integer in big-endian format followed by a 4-character string".
I think the error you are running into is that the chunk you are passing in does not have 8 characters. Is your input truncated somehow?
-- Robert Kern [EMAIL PROTECTED]
"In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list