python-lottie  0.6.10+dev4166086
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:
[legend]
Collaboration diagram for lottie.objects.assets.Image:
[legend]

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 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 __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

 height
 Image Height. More...
 
 width
 Image Width. More...
 
 id
 Image ID. More...
 
 image
 Image name. More...
 
 image_path
 Image path. More...
 
 is_embedded
 Image data is stored as a data: url. More...
 

Detailed Description

External image.

See also
http://docs.aenhancers.com/sources/filesource/
Lottie JSON
Lottie name Type Description Attribute
h float Image Height.   height
w float Image Width.   width
id str Image ID.   id
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 23 of file assets.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 48 of file assets.py.

Member Function Documentation

◆ embedded()

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

Create an object from an image file.

Definition at line 101 of file assets.py.

◆ guess_mime()

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

Definition at line 39 of file assets.py.

◆ 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 120 of file assets.py.

◆ linked()

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

Definition at line 109 of file assets.py.

◆ load()

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

Definition at line 62 of file assets.py.

Member Data Documentation

◆ height

lottie.objects.assets.Image.height

Image Height.

Definition at line 50 of file assets.py.

◆ id

lottie.objects.assets.Image.id

Image ID.

Definition at line 54 of file assets.py.

◆ image

lottie.objects.assets.Image.image

Image name.

Definition at line 56 of file assets.py.

◆ image_path

lottie.objects.assets.Image.image_path

Image path.

Definition at line 58 of file assets.py.

◆ is_embedded

lottie.objects.assets.Image.is_embedded

Image data is stored as a data: url.

Definition at line 60 of file assets.py.

◆ width

lottie.objects.assets.Image.width

Image Width.

Definition at line 52 of file assets.py.


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