#!/bin/bash
########################################################################
#                                                                      #
#  NEMO action script that converts webp and png files to jpg files    #
#  Depends on: ffmpeg                                                  #
#                                                                      #
#  Koentje  (remon@cobrasoft.nl)                                       #
#                                                                      #
########################################################################

webp="$1"
jpeg="${1%.*}.jpg"


if [ -z "$1" ]; then
  echo -e "\n* Converts webp files to jpg.\n"
else

  ffmpeg -y -i "$webp" "$jpeg"
  sleep .5
    if [ -f "$jpeg" ]; then
      rm -f "$webp"
    fi

fi

