Skip to content

Commit

Permalink
png_file fixed (IHDR was wrong)
Browse files Browse the repository at this point in the history
  • Loading branch information
arekbulski committed Aug 22, 2016
1 parent ef523d3 commit 0d13533
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions construct/formats/graphics/png.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
coding conventions)
"""
from construct import *
import six


#===============================================================================
Expand Down Expand Up @@ -318,7 +317,7 @@ def splt_info_data_length(ctx):

image_header_chunk = Struct("image_header",
UBInt32("length"),
Const(String("type", 4), "IHDR"),
Magic(b"IHDR"),
UBInt32("width"),
UBInt32("height"),
UBInt8("bit_depth"),
Expand Down Expand Up @@ -349,7 +348,7 @@ def splt_info_data_length(ctx):
# the complete PNG file
#===============================================================================
png_file = Struct("png",
Magic(six.b("\x89PNG\r\n\x1a\n")),
Magic(b"\x89PNG\r\n\x1a\n"),
image_header_chunk,
Rename("chunks", GreedyRange(chunk)),
)

0 comments on commit 0d13533

Please sign in to comment.