mirror of
https://github.com/nxshock/gallery.git
synced 2024-11-28 00:21:01 +05:00
Compare commits
2 Commits
328331768a
...
41d00de7b7
Author | SHA1 | Date | |
---|---|---|---|
41d00de7b7 | |||
378a467f65 |
@ -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))
|
||||
fileNames[i] = strings.TrimPrefix(filepath.ToSlash(fileNames[i]), filepath.ToSlash(config.WorkingDirectory))[1:] // TODO: check is first slash properly removed
|
||||
}
|
||||
|
||||
items := make([]Item, 0)
|
||||
|
@ -60,11 +60,11 @@ func (pc *PreviewCache) Add(filePath string) ([]byte, error) {
|
||||
"-f", "avif",
|
||||
tempFileName)
|
||||
} else {
|
||||
cmd = exec.Command("ffmpeg.exe",
|
||||
cmd = exec.Command("ffmpeg",
|
||||
"-i", filepath.FromSlash(filePath),
|
||||
"-vf", "scale=240:240:force_original_aspect_ratio=increase,crop=240:240:exact=1",
|
||||
"-frames:v", "1",
|
||||
"-crf", "40",
|
||||
"-crf", strconv.FormatUint(config.Crf, 10),
|
||||
"-f", "avif",
|
||||
tempFileName)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user