From 009af426171025f56aa43831647d3854310308ce Mon Sep 17 00:00:00 2001 From: iperov Date: Tue, 26 Mar 2019 18:23:39 +0400 Subject: [PATCH] fix converter issue #205 --- mainscripts/Converter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mainscripts/Converter.py b/mainscripts/Converter.py index c5bdae0..e7cb231 100644 --- a/mainscripts/Converter.py +++ b/mainscripts/Converter.py @@ -54,7 +54,12 @@ class ConvertSubprocessor(Subprocessor): if self.converter.type == Converter.TYPE_FACE and filename_path.stem not in self.alignments.keys(): if not self.debug: self.log_info ( 'no faces found for %s, copying without faces' % (filename_path.name) ) - shutil.copy ( str(filename_path), str(output_filename_path) ) + + if filename_path.suffix == '.png': + shutil.copy ( str(filename_path), str(output_filename_path) ) + else: + image = cv2_imread(str(filename_path)) + cv2_imwrite ( str(output_filename_path), image ) else: image = (cv2_imread(str(filename_path)) / 255.0).astype(np.float32)