diff --git a/config/config.go b/config/config.go index b5d3e12..81b4535 100644 --- a/config/config.go +++ b/config/config.go @@ -27,6 +27,7 @@ type Watcher struct { Path string Username string NoWatermark bool + HoldUploads bool Exclude []string } diff --git a/imageprocess/thumb.go b/imageprocess/thumb.go index 58fba9d..2405fed 100644 --- a/imageprocess/thumb.go +++ b/imageprocess/thumb.go @@ -28,7 +28,6 @@ func (ip *Processor) ThumbPNG(ul *upload.Upload, w io.Writer) error { } newXY := image.Point{} - // test width if im.Bounds().Max.X/thumbnailMaxX > im.Bounds().Max.Y/thumbnailMaxY { newXY.X = thumbnailMaxX newXY.Y = im.Bounds().Max.Y / (im.Bounds().Max.X / thumbnailMaxX) diff --git a/upload/upload.go b/upload/upload.go index d8482bf..bb742a9 100644 --- a/upload/upload.go +++ b/upload/upload.go @@ -83,7 +83,12 @@ func (u *Uploader) AddFile(file string, conf config.Watcher) { watermark: !conf.NoWatermark, webhookURL: conf.WebHookURL, usernameOverride: conf.Username, - State: StatePending, + State: StateQueued, + } + // if the user wants uploads to be held for editing etc, + // set it to Pending instead + if conf.HoldUploads { + thisUpload.State = StatePending } u.Uploads = append(u.Uploads, &thisUpload) } diff --git a/web/data/config.html b/web/data/config.html index 36d4425..1137433 100644 --- a/web/data/config.html +++ b/web/data/config.html @@ -105,6 +105,15 @@ +