mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-26 05:58:27 -05:00
feat: add maximum image file size to be processed by the thumbnailer (#9069)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"github.com/cs3org/reva/v2/pkg/bytesize"
|
||||
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/registry"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/service/grpc"
|
||||
@@ -54,19 +55,25 @@ func NewService(opts ...Option) grpc.Service {
|
||||
options.Logger.Error().Err(err).Msg("could not get gateway selector")
|
||||
return grpc.Service{}
|
||||
}
|
||||
b, err := bytesize.Parse(tconf.MaxInputImageFileSize)
|
||||
if err != nil {
|
||||
options.Logger.Error().Err(err).Msg("could not parse MaxInputImageFileSize")
|
||||
return grpc.Service{}
|
||||
}
|
||||
|
||||
var thumbnail decorators.DecoratedService
|
||||
{
|
||||
thumbnail = svc.NewService(
|
||||
svc.Config(options.Config),
|
||||
svc.Logger(options.Logger),
|
||||
svc.ThumbnailSource(imgsource.NewWebDavSource(tconf)),
|
||||
svc.ThumbnailSource(imgsource.NewWebDavSource(tconf, b)),
|
||||
svc.ThumbnailStorage(
|
||||
storage.NewFileSystemStorage(
|
||||
tconf.FileSystemStorage,
|
||||
options.Logger,
|
||||
),
|
||||
),
|
||||
svc.CS3Source(imgsource.NewCS3Source(tconf, gatewaySelector)),
|
||||
svc.CS3Source(imgsource.NewCS3Source(tconf, gatewaySelector, b)),
|
||||
svc.GatewaySelector(gatewaySelector),
|
||||
)
|
||||
thumbnail = decorators.NewInstrument(thumbnail, options.Metrics)
|
||||
|
||||
Reference in New Issue
Block a user