python-lottie  0.6.10+dev42a5126
A framework to work with lottie files and telegram animated stickers (tgs)
lottie.objects.assets.Image Class Reference

External image. More...

Inheritance diagram for lottie.objects.assets.Image:
Collaboration diagram for lottie.objects.assets.Image:

Public Member Functions

def __init__ (self, id="")
def load (self, file, format=None)
def embedded (cls, image, format=None)
 Create an object from an image file. More...
def linked (cls, filename)
def image_data (self)
- Public Member Functions inherited from lottie.objects.base.LottieObject
def __init__ (self)
def to_dict (self)
 Serializes into a JSON object fit for the Lottie format. More...
def load (cls, lottiedict)
 Loads from a JSON object. More...
def find (self, search, propname="name")
 Recursively searches for child objects with a matching property. More...
def find_all (self, type, predicate=None, include_self=True)
 Find all child objects that match a predicate. More...
def clone (self)
 Returns a copy of the object. More...
def clone_into (self, other)
def __str__ (self)
- Public Member Functions inherited from lottie.objects.base.LottieObjectMeta
def __new__ (cls, name, bases, attr)

Static Public Member Functions

def guess_mime (file)

Public Attributes

 Image Height. More...
 Image Width. More...
 Image ID. More...
 Image name. More...
 Image path. More...
 Image data is stored as a data: url. More...

Detailed Description

External image.

See also
Lottie JSON
Lottie name Type Description Attribute
id str Image ID.   id
h float Image Height.   height
w float Image Width.   width
p str Image name.   image
u str Image path.   image_path
e 0-1 int Image data is stored as a data: url.   is_embedded

Definition at line 26 of file

Constructor & Destructor Documentation

◆ __init__()

def lottie.objects.assets.Image.__init__ (   self,
  id = "" 

Definition at line 50 of file

Member Function Documentation

◆ embedded()

def lottie.objects.assets.Image.embedded (   cls,
  format = None 

Create an object from an image file.

Definition at line 103 of file

◆ guess_mime()

def lottie.objects.assets.Image.guess_mime (   file)

Definition at line 41 of file

◆ image_data()

def lottie.objects.assets.Image.image_data (   self)
Returns a tuple (format, data) with the contents of the image

`format` is a string like "png", and `data` is just raw binary data.

If it's impossible to fetch this info, returns (None, None)

Definition at line 122 of file

◆ linked()

def lottie.objects.assets.Image.linked (   cls,

Definition at line 111 of file

◆ load()

def lottie.objects.assets.Image.load (   self,
  format = None 
fileFilename, file object, or PIL.Image.Image to load
formatFormat to store the image data as

Definition at line 64 of file

Member Data Documentation

◆ height


Image Height.

Definition at line 52 of file

◆ id

Image ID.

Definition at line 56 of file

◆ image


Image name.

Definition at line 58 of file

◆ image_path


Image path.

Definition at line 60 of file

◆ is_embedded


Image data is stored as a data: url.

Definition at line 62 of file

◆ width


Image Width.

Definition at line 54 of file

The documentation for this class was generated from the following file: