Use Python version of Jpegize as a preparation
This commit is contained in:
10
mpegize.py
10
mpegize.py
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
# Copyright 2022 Pavel Machek, GPLv2+
|
||||
# Copyright 2022, 2024 Pavel Machek, GPLv2+
|
||||
|
||||
import os, sys, time, copy, subprocess
|
||||
|
||||
@@ -64,7 +64,9 @@ class Mpegize:
|
||||
m.stat_gaps("sa")
|
||||
return
|
||||
if mode == "jpegize":
|
||||
m.prepare()
|
||||
m.jpegize()
|
||||
return
|
||||
m.help()
|
||||
|
||||
def stat_gaps(m, e):
|
||||
@@ -212,8 +214,8 @@ class Mpegize:
|
||||
|
||||
def jpegize(m):
|
||||
i = 0
|
||||
os.chdir(m.source)
|
||||
l = os.listdir(m.source)
|
||||
os.chdir(m.base)
|
||||
l = os.listdir(m.base)
|
||||
l = filter(lambda n: n[-4:] == ".dng", l)
|
||||
l = list(l)
|
||||
l.sort()
|
||||
@@ -235,7 +237,7 @@ class Mpegize:
|
||||
'-T', n]) # -T Output TIFF
|
||||
subprocess.run(['convert', base+'.tiff', base+'.jpeg'])
|
||||
os.unlink(base+'.tiff')
|
||||
os.rename(base+'.jpeg', base+'.jpeg.sv')
|
||||
os.rename(base+'.jpeg', m.source+"/"+base+'.jpeg.sv')
|
||||
|
||||
m = Mpegize()
|
||||
m.run(sys.argv)
|
||||
|
Reference in New Issue
Block a user