feat: use real image path to calculate cache key

This commit is contained in:
Oleg Lobanov 2022-02-21 19:59:22 +01:00
parent cf85404dd2
commit c1987237d0
No known key found for this signature in database
GPG key ID: 65FF3DB864FE3D2A
3 changed files with 18 additions and 5 deletions

View file

@ -185,6 +185,19 @@ func (i *FileInfo) Checksum(algo string) error {
return nil
}
func (i *FileInfo) RealPath() string {
if realPathFs, ok := i.Fs.(interface {
RealPath(name string) (fPath string, err error)
}); ok {
realPath, err := realPathFs.RealPath(i.Path)
if err == nil {
return realPath
}
}
return i.Path
}
//nolint:goconst
//TODO: use constants
func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error {