class_docstr: PIL image support for Mac OS .icns files.
  Chooses the best resolution, but will possibly load
  a different size image if you mutate the size attribute
  before calling 'load'.
  
  The info dictionary has a key 'sizes' that is a list
  of sizes that the icns file has.
class_docstr_tok: ["PIL","image","support","for","Mac","OS",".icns","files",".","Chooses","the","best","resolution",",","but","will","possibly","load","a","different","size","image","if","you","mutate","the","size","attribute","before","calling","'load","'",".","The","info","dictionary","has","a","key","'sizes","'","that","is","a","list","of","sizes","that","the","icns","file","has","."]
code: def load(self):
      if len(self.size) == 3:
          self.best_size = self.size
          self.size = (
              self.best_size[0] * self.best_size[2],
              self.best_size[1] * self.best_size[2],
          )
  
      Image.Image.load(self)
      if self.im and self.im.size == self.size:
          # Already loaded
          return
      self.load_prepare()
      # This is likely NOT the best way to do it, but whatever.
      im = self.icns.getimage(self.best_size)
  
      # If this is a PNG or JPEG 2000, it won't be loaded yet
      im.load()
  
      self.im = im.im
      self.mode = im.mode
      self.size = im.size
      self.load_end()
  
imports: import io
  import os
  import struct
  import sys
  from PIL import Image, ImageFile, PngImagePlugin, features
label_desc: Use image node_id 4 for calling the IcnsImageFile obj's underlying member method code with example usage: obj.load() without return types