chore: add resize tests

This commit is contained in:
Oleg Lobanov
2020-07-24 20:08:26 +02:00
parent aa78e3ab1f
commit cb8ac5ebf1
5 changed files with 449 additions and 33 deletions

View File

@@ -8,7 +8,6 @@ import (
"net/http"
"github.com/gorilla/mux"
"github.com/spf13/afero"
"github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/v2/img"
@@ -21,7 +20,7 @@ const (
type ImgService interface {
FormatFromExtension(ext string) (img.Format, error)
Resize(ctx context.Context, file afero.File, width, height int, out io.Writer, options ...img.Option) error
Resize(ctx context.Context, in io.Reader, width, height int, out io.Writer, options ...img.Option) error
}
func previewHandler(imgSvc ImgService, enableThumbnails, resizePreview bool) handleFunc {