                  outfile.write(image.read())
          except Exception as err:  # pylint: disable=broad-except
              logger.error("Failed to save image '%s'. Original Error: %s", filename, err)
  
      def output_filename(self, filename):
          """ Return the output filename with the correct folder and extension """
          out_filename = "{}.{}".format(os.path.splitext(filename)[0], self.config["format"])
          out_filename = os.path.join(self.output_folder, out_filename)
          logger.trace("in filename: '%s', out filename: '%s'", filename, out_filename)
          return out_filename
  
      def pre_encode(self, image):
          logger.trace("Pre-encoding image")
          fmt = self.format_dict.get(self.config["format"], None)
          fmt = self.config["format"].upper() if fmt is None else fmt
          encoded = BytesIO()
 
</s> remove         out_filename = "{}.{}".format(os.path.splitext(filename)[0], self.config["format"])
 </s> add         filename = os.path.splitext(os.path.basename(filename))[0]
        out_filename = "{}.{}".format(filename, self.config["format"]) </s> remove         filename = os.path.splitext(filename)[0]
 </s> add         filename = os.path.splitext(os.path.basename(filename))[0] </s> remove             retval = sum([fr[1] - fr[0] for fr in self.frame_ranges])
 </s> add             retval = sum([fr[1] - fr[0] + 1 for fr in self.frame_ranges]) </s> remove import os
 </s> add 
                  outfile.write(image.read())
          except Exception as err:  # pylint: disable=broad-except
              logger.error("Failed to save image '%s'. Original Error: %s", filename, err)
  







      def pre_encode(self, image):
          logger.trace("Pre-encoding image")
          fmt = self.format_dict.get(self.config["format"], None)
          fmt = self.config["format"].upper() if fmt is None else fmt
          encoded = BytesIO()
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 Bugfixes [convert[: Correct output folder. Correct tqdm for skipped frames. 
plugins/convert/writer/pillow.py