mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-02 02:42:05 +02:00
[Node] ExtractMetadata: Replace os.system with subprocess.Popen
This commit is contained in:
parent
f1d68b660c
commit
3e854e7b38
1 changed files with 5 additions and 4 deletions
|
@ -7,6 +7,7 @@ import distutils.dir_util as du
|
||||||
import shutil
|
import shutil
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class ExtractMetadata(desc.Node):
|
class ExtractMetadata(desc.Node):
|
||||||
|
@ -106,10 +107,10 @@ Using exifTool, this node extracts metadata of all images referenced in a sfmDat
|
||||||
else: #xmp
|
else: #xmp
|
||||||
cmd = 'exiftool -tagsfromfile ' + iFile + ' ' + chunk.node.arguments.value.strip() + ' ' + oFile
|
cmd = 'exiftool -tagsfromfile ' + iFile + ' ' + chunk.node.arguments.value.strip() + ' ' + oFile
|
||||||
chunk.logger.debug(cmd)
|
chunk.logger.debug(cmd)
|
||||||
try:
|
error = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).stderr.read().decode()
|
||||||
os.system(cmd)
|
chunk.logger.debug(error)
|
||||||
except:
|
if error != "":
|
||||||
chunk.logger.error("exifTool command failed ! Check that exifTool can be accessed on your system.")
|
chunk.logger.error(error)
|
||||||
raise RuntimeError(error)
|
raise RuntimeError(error)
|
||||||
if not os.path.exists(oFile):
|
if not os.path.exists(oFile):
|
||||||
info = 'No metadata extracted for file ' + iFile
|
info = 'No metadata extracted for file ' + iFile
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue