def addFile(self, relPath, fullPath): """Adds the specific file to the sprite packer.""" fileType = relPath.split('.')[-1] if fileType not in self.types: raise Exception('Unsupported image format: %s' % fileType) # Load image and grab required information img = ImgInfo(fullPath) width, height = img.getSize() checksum = img.getChecksum() self.files.append(SpriteFile(width, height, relPath, fullPath, checksum)) Console.debug('- Found image "%s" (%dx%dpx)' % (relPath, width, height))
def addFile(self, relPath, fullPath): """Adds the specific file to the sprite packer.""" fileType = relPath.split('.')[-1] if fileType not in self.types: raise Exception('Unsupported image format: %s' % fileType) # Load image and grab required information img = ImgInfo(fullPath) width, height = img.getSize() checksum = img.getChecksum() self.files.append( SpriteFile(width, height, relPath, fullPath, checksum)) Console.debug('- Found image "%s" (%dx%dpx)' % (relPath, width, height))
def addFile(self, relPath, fullPath): """Adds the specific file to the sprite packer.""" fileType = relPath.split('.')[-1] if fileType not in self.types: raise Exception('Unsupported image format: %s' % fileType) # Load image and grab required information img = ImgInfo(fullPath) w, h = img.getSize() checksum = img.getChecksum() del img # TODO crop transparent "borders" # TODO allow for rotation self.files.append(SpriteFile(w, h, relPath, fullPath, checksum)) Console.debug('- Found image "%s" (%dx%dpx)' % (relPath, w, h))
def addFile(self, relPath, fullPath): """Adds the specific file to the sprite packer.""" fileType = relPath.split(".")[-1] if fileType not in self.types: raise Exception("Unsupported image format: %s" % fileType) # Load image and grab required information img = ImgInfo(fullPath) w, h = img.getSize() checksum = img.getChecksum() del img # TODO crop transparent "borders" # TODO allow for rotation self.files.append(SpriteFile(w, h, relPath, fullPath, checksum)) debug('- Found image "%s" (%dx%dpx)' % (relPath, w, h))