def open_pack(self):
        '''
        Opens the zip file and puts texture data into a dictionary, where the key is the texture file name, and the value is a PIL.Image instance
        '''
        zfile = zipfile.ZipFile(self.zipfile)
        self.fps = []
        for name in zfile.infolist():
            if name.filename.endswith(".png") and not name.filename.split(os.path.sep)[-1].startswith("._"):
                filename = "assets/minecraft/textures/blocks"
                if name.filename.startswith(filename) and name.filename.replace(filename+"/", "").replace(".png","") in textureSlots:
                    log.debug("            Is a possible texture.")
                    block_name = os.path.normpath(name.filename).split(os.path.sep)[-1]
                    block_name = block_name.split(".")[0]
                    log.debug("            Block name: %s"%block_name)
                    log.debug("            Opening %s"%name)
                    fp = zfile.open(name)
                    #!# Sending this 'fp' file descriptor to PIL.Image does not work, because such
                    #!# descriptors are not seekable.
                    #!# But, reading the fd data and writing it to a temporary file seem to work...
                    log.debug("                Done. (%s, seekable: %s, readable: %s)"%(type(fp), fp.seekable(), fp.readable()))
                    log.debug("            Saving fp data to temp file.")
                    fp1 = StringIO()
                    fp1.write(fp.read())
                    fp.close()
                    fp1.seek(0)
                    log.debug("                Done.")
                    try:
                        possible_texture = Image.open(fp1)
                        log.debug("            File descriptor for %s opened."%block_name)
                        log.debug("            Is %s."%repr(possible_texture.size))
                    except Exception as e:
                        log.debug("            Can't open descriptor for %s"%block_name)
                        log.debug("            System said:")
                        log.debug("            %s"%repr(e))
                    if possible_texture.size == (16, 16):
                        self.block_image[block_name] = possible_texture
                        if block_name.startswith("repeater_") or block_name.startswith("comparator_"):
                            self.block_image[block_name+"_west"] = possible_texture.rotate(-90)
                            self.block_image[block_name+"_north"] = possible_texture.rotate(180)
                            self.block_image[block_name+"_east"] = possible_texture.rotate(90)
                            self.block_image[block_name+"_south"] = possible_texture
                        if block_name == "piston_side":
                            self.block_image["piston_up"] = possible_texture
                            self.block_image["piston_left"] = possible_texture.rotate(90)
                            self.block_image["piston_down"] = possible_texture.rotate(180)
                            self.block_image["piston_right"] = possible_texture.rotate(-90)
                        if block_name == "hay_block_side":
                            self.block_image["hay_block_side_rotated"] = possible_texture.rotate(-90)
                        if block_name == "quartz_block_lines":
                            self.block_image["quartz_block_lines_rotated"] = possible_texture.rotate(-90)
                        if block_name.startswith("bed_"):
                            if block_name == "bed_head_side":
                                self.block_image["bed_head_side_flipped"] = possible_texture.transpose(Image.FLIP_LEFT_RIGHT)
                            if block_name == "bed_feet_side":
                                self.block_image["bed_feet_side_flipped"] = possible_texture.transpose(Image.FLIP_LEFT_RIGHT)
                            if block_name == "bed_head_top":
                                self.block_image["bed_head_top_flipped"] = possible_texture.transpose(Image.FLIP_LEFT_RIGHT)
                                self.block_image["bed_head_top_bottom"] = possible_texture.rotate(-90)
                                self.block_image["bed_head_top_top"] = possible_texture.rotate(90)
                            if block_name == "bed_feet_top":
                                self.block_image["bed_feet_top_flipped"] = possible_texture.transpose(Image.FLIP_LEFT_RIGHT)
                                self.block_image["bed_feet_top_bottom"] = possible_texture.rotate(-90)
                                self.block_image["bed_feet_top_top"] = possible_texture.rotate(90)
                        log.debug("             Is loaded.")
                    else:
                        if possible_texture.size == (32, 32):
                            self.block_image[block_name] = possible_texture.resize((16, 16))
                            log.debug("             Is loaded.")
                        elif possible_texture.size == (64, 64) or possible_texture.size == (128, 128) or possible_texture.size == (256, 256):
                            self.big_textures_counted += 1
                            log.debug("             Is too big.")
                        else:
                            self.block_image[block_name] = possible_texture.crop((0,0,16,16))
                            log.debug("             Is loaded.")
                    self.fps.append(fp1)
        if self.big_textures_counted >= self.big_textures_max:
            self.handle_too_big_packs()
        else:
            try:
                self.parse_terrain_png()
            except Exception:
                traceback.print_exc()
                log.warning('Encountered an Exception while parsing terrain texture')
                self._too_big = True
                pass

        Opens the zip file and puts texture data into a dictionary, where the key is the texture file name, and the value is a PIL.Image instance
        
resource_packs.py