Commit b36d99f9 authored by Jan Provaznik's avatar Jan Provaznik Committed by Yorick Peterse

Allow to disable exiftool if env variable is set

This allows more flexible way to enable/disable exiftool
parent e20fd68c
---
title: Allow to disable exiftool depending on env variable.
merge_request:
author:
type: security
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"os"
"os/exec" "os/exec"
"regexp" "regexp"
...@@ -101,6 +102,9 @@ func (c *cleaner) startProcessing(stdin io.Reader) error { ...@@ -101,6 +102,9 @@ func (c *cleaner) startProcessing(stdin io.Reader) error {
} }
func IsExifFile(filename string) bool { func IsExifFile(filename string) bool {
if os.Getenv("SKIP_EXIFTOOL") == "1" {
return false
}
filenameMatch := regexp.MustCompile(`(?i)\.(jpg|jpeg|tiff)$`) filenameMatch := regexp.MustCompile(`(?i)\.(jpg|jpeg|tiff)$`)
return filenameMatch.MatchString(filename) return filenameMatch.MatchString(filename)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment