diff --git a/files/file.go b/files/file.go index 4c0eb0d3..ed0012e7 100644 --- a/files/file.go +++ b/files/file.go @@ -6,7 +6,6 @@ import ( "crypto/sha256" "crypto/sha512" "encoding/hex" - "github.com/spf13/afero" "hash" "image" "io" @@ -19,6 +18,8 @@ import ( "strings" "time" + "github.com/spf13/afero" + "github.com/filebrowser/filebrowser/v2/errors" "github.com/filebrowser/filebrowser/v2/rules" ) @@ -276,8 +277,7 @@ func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error { return nil } -func calculateImageResolution(fs afero.Fs, filepath string) (*ImageResolution, error) { - file, err := fs.Open(filepath) +func calculateImageResolution(fs afero.Fs, filePath string) (*ImageResolution, error) { if err != nil { return nil, err }