File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def _open(self) -> None:
5454 width = i32 (self .fp .read (4 ))
5555 height = i32 (self .fp .read (4 ))
5656 color_depth = i32 (self .fp .read (4 ))
57- if width <= 0 or height < = 0 :
57+ if width == 0 or height = = 0 :
5858 msg = "not a GIMP brush"
5959 raise SyntaxError (msg )
6060 if color_depth not in (1 , 4 ):
@@ -71,7 +71,7 @@ def _open(self) -> None:
7171 raise SyntaxError (msg )
7272 self .info ["spacing" ] = i32 (self .fp .read (4 ))
7373
74- comment = self .fp .read (comment_length )[:- 1 ]
74+ self . info [ " comment" ] = self .fp .read (comment_length )[:- 1 ]
7575
7676 if color_depth == 1 :
7777 self ._mode = "L"
@@ -80,8 +80,6 @@ def _open(self) -> None:
8080
8181 self ._size = width , height
8282
83- self .info ["comment" ] = comment
84-
8583 # Image might not be small
8684 Image ._decompression_bomb_check (self .size )
8785
You can’t perform that action at this time.
0 commit comments