diff --git a/processor.go b/processor.go index 187c0b0..94f3847 100644 --- a/processor.go +++ b/processor.go @@ -83,7 +83,8 @@ func subThumbnail(url string) string { Height: 400, } path := imagorpath.Generate(params, imagorpath.NewHMACSigner(sha256.New, 0, key)) - return path + signature := path[:strings.IndexByte(path, '/')] + return signature } // Process implements imagor.Processor interface @@ -156,7 +157,8 @@ func (p *Processor) Process(ctx context.Context, in *imagor.Blob, params imagorp case "og:image": fallthrough case "twitter:image:src": - meta.Image = subThumbnail(val) + meta.ImageSignature = subThumbnail(val) + meta.Image = val break case "og:title": @@ -190,6 +192,7 @@ type Metadata struct { Title string `json:"title"` Description string `json:"description"` Image string `json:"image"` + ImageSignature string `json:"image_signature"` Hostname string `json:"hostname"` SpecialHandler string `json:"special_handler"` SpecialData map[string]string `json:"special_data"`