docs: def resize_image(self, data, size):
          """ Resizes the given image to fit inside a box of the given size. """
          from machina.core.compat import PILImage as Image
          image = Image.open(BytesIO(data))
  
          # Resize!
          image.thumbnail(size, Image.ANTIALIAS)
  
          string = BytesIO()
          image.save(string, format='PNG')
          return string.getvalue()