diff --git a/handlers.go b/handlers.go index 9d111ad..4e08d9d 100644 --- a/handlers.go +++ b/handlers.go @@ -15,7 +15,7 @@ func getResponse(path string) ([]Item, error) { } for i := range fileNames { - fileNames[i] = strings.TrimPrefix(filepath.ToSlash(fileNames[i]), filepath.ToSlash(config.WorkingDirectory))[1:] // TODO: check is first slash properly removed + fileNames[i] = strings.TrimPrefix(filepath.ToSlash(fileNames[i]), filepath.ToSlash(config.WorkingDirectory)) } items := make([]Item, 0) diff --git a/preview.go b/preview.go index 5a5df6b..63548e0 100644 --- a/preview.go +++ b/preview.go @@ -60,11 +60,11 @@ func (pc *PreviewCache) Add(filePath string) ([]byte, error) { "-f", "avif", tempFileName) } else { - cmd = exec.Command("ffmpeg", + cmd = exec.Command("ffmpeg.exe", "-i", filepath.FromSlash(filePath), "-vf", "scale=240:240:force_original_aspect_ratio=increase,crop=240:240:exact=1", "-frames:v", "1", - "-crf", strconv.FormatUint(config.Crf, 10), + "-crf", "40", "-f", "avif", tempFileName) }