isolate signature in images
This commit is contained in:
parent
17d4d46d09
commit
4f4f7ac6e2
1 changed files with 5 additions and 2 deletions
|
|
@ -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"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue