Ajout mp4 et nouveaux modèles

This commit is contained in:
Francois Pelletier 2023-05-17 16:00:09 -04:00
parent 5c9786dd41
commit 864c58e7ce
3 changed files with 7 additions and 1 deletions

View file

@ -11,6 +11,9 @@ class DocumentSpecs(BaseModel):
fontsize: int
paperwidth: int
paperheight: int
ratio: int
margin: int
vmargin: int
extension: str
fps: int
stilltime: int

View file

@ -8,6 +8,9 @@ class FormatParameters(BaseModel):
fontsize: int
paperwidth: int
paperheight: int
ratio: int
margin: int
vmargin: int
extension: str
fps: int
stilltime: int

View file

@ -21,7 +21,7 @@ def convert_pdf(filename, filetype, output_path, resolution=300):
img.alpha_channel = 'remove'
image_filename = os.path.splitext(os.path.basename(filename))[0]
image_filename = f'{image_filename}-{i}.{filetype}'
image_filename = f'{image_filename}-{i:03}.{filetype}'
image_filename = os.path.join(output_path, image_filename)
img.save(filename=image_filename)