Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nml/spriteencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def encode_sprite(self, sprite_info):
if im.mode == "RGBA":
info_byte |= INFO_ALPHA

(im_width, im_height) = im.size
im_width, im_height = im.size
if x < 0 or y < 0 or x + size_x > im_width or y + size_y > im_height:
pos = generic.build_position(sprite_info.poslist)
raise generic.ScriptError("Read beyond bounds of image file '{}'".format(filename_32bpp.value), pos)
Expand All @@ -320,7 +320,7 @@ def encode_sprite(self, sprite_info):
im_mask_pal = palette.validate_palette(mask_im, filename_8bpp.value)
info_byte |= INFO_PAL

(im_width, im_height) = mask_im.size
im_width, im_height = mask_im.size
if mask_x < 0 or mask_y < 0 or mask_x + size_x > im_width or mask_y + size_y > im_height:
pos = generic.build_position(sprite_info.poslist)
raise generic.ScriptError("Read beyond bounds of image file '{}'".format(filename_8bpp.value), pos)
Expand Down