Skip to content

Commit

Permalink
only add .jpg extension when the output dir is different from the input
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Sep 8, 2019
1 parent af3da97 commit f51690e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ func do(j *job) {
}

outputFileName := j.fileName
outputFileName = strings.TrimSuffix(strings.TrimSuffix(outputFileName, filepath.Ext(outputFileName)), ".") + ".jpg"

if j.settings.source != j.settings.output {
outputFileName = strings.TrimSuffix(strings.TrimSuffix(outputFileName, filepath.Ext(outputFileName)), ".") + ".jpg"
}

args = append(args, j.settings.source+j.fileName)
args = append(args, j.settings.output+outputFileName)
Expand Down

0 comments on commit f51690e

Please sign in to comment.