Browse Source

Merge pull request #53 from PommeDroid/fix-gif

Fix Gif processing
tags/v1.2.10
deeppppp 2 years ago
parent
commit
66fd1e71dc
No account linked to committer's email address
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      processing/gif.py

+ 6
- 5
processing/gif.py View File

@@ -8,8 +8,8 @@ import imageio

from config import Config as Conf
from processing import Processing
from processing.multiple import MultipleImageProcessing
from processing.utils import select_phases
from processing.multiple_image import MultipleImageProcessing
from utils import write_image


@@ -24,8 +24,8 @@ class GifProcessing(Processing):
"""
super().__init__(args=args)
self.__phases = select_phases(self._args)
self.__input_path = args['input_path']
self.__output_path = args['output_path']
self.__input_path = args['input']
self.__output_path = args['output']
self.__tmp_dir = None
self.__temp_input_paths = []
self.__temp_output_paths = []
@@ -37,9 +37,10 @@ class GifProcessing(Processing):
Conf.log.info("GIF have {} Frames To Process".format(len(imgs)))
self.__temp_input_paths = [os.path.join(self.__tmp_dir, "intput_{}.png".format(i))
for i in range(len(imgs))]
self._args['input'] = self.__temp_input_paths
self.__temp_output_paths = [os.path.join(self.__tmp_dir, "output_{}.png".format(i))
for i in range(len(imgs))]
self._args['output'] = self.__temp_output_paths

for i in zip(imgs, self.__temp_input_paths):
write_image(cv2.cvtColor(i[0], cv2.COLOR_RGB2BGR), i[1])
@@ -50,7 +51,7 @@ class GifProcessing(Processing):

:return: None
"""
MultipleImageProcessing(self.__temp_input_paths, self.__phases, self.__temp_output_paths, args=self._args).run()
MultipleImageProcessing(args=self._args).run()

dir_out = os.path.dirname(self.__output_path)
if dir_out != '':

Loading…
Cancel
Save