feat: update reset thumbnail feature (#2854)
* update reset thumbnail feature * consolidate supported thumbnail extensions into site config; remove dedicated API * allow patching thumb ; remove Reset Thumbnail API * fix code formatting --------- Co-authored-by: Aaron Liu <abslant.liu@gmail.com>
This commit is contained in:
@@ -97,6 +97,15 @@ var (
|
||||
},
|
||||
},
|
||||
"dav": {},
|
||||
// Allow manipulating thumbnail metadata via public PatchMetadata API
|
||||
"thumb": {
|
||||
// Only supported thumb metadata currently is thumb:disabled
|
||||
dbfs.ThumbDisabledKey: func(ctx context.Context, m *manager, patch *fs.MetadataPatch) error {
|
||||
// Presence of this key disables thumbnails; value is ignored.
|
||||
// We allow both setting and removing this key.
|
||||
return nil
|
||||
},
|
||||
},
|
||||
customizeMetadataSuffix: {
|
||||
iconColorMetadataKey: validateColor(false),
|
||||
emojiIconMetadataKey: func(ctx context.Context, m *manager, patch *fs.MetadataPatch) error {
|
||||
|
||||
@@ -19,6 +19,10 @@ import (
|
||||
|
||||
const thumbTempFolder = "thumb"
|
||||
|
||||
// BuiltinSupportedExts lists file extensions supported by the built-in
|
||||
// thumbnail generator. Extensions are lowercased and do not include the dot.
|
||||
var BuiltinSupportedExts = []string{"jpg", "jpeg", "png", "gif"}
|
||||
|
||||
// Thumb 缩略图
|
||||
type Thumb struct {
|
||||
src image.Image
|
||||
|
||||
Reference in New Issue
Block a user