Add filename to image information.

This fixes #6.
develop
Icedream 2016-08-08 14:05:55 +02:00
parent 1e3af32706
commit 3faff8264f
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
2 changed files with 16 additions and 12 deletions

View File

@ -67,12 +67,16 @@
({{ . }})
{{ end }}
{{ else }}
{{ if index . "Description" }}
{{ excerpt 384 (index . "Description") }}
{{ else }}
{{ with index . "ImageType" }}
{{ . }} image,
{{ with index . "Description" }}
{{ excerpt 384 . }}
{{ end }}
{{ end }}
{{ if index . "ImageType" }}
{{ if index . "Title" }}
·
{{ end }}
{{ .ImageType }} image,
{{ if (index . "ImageSize") (index . "Size") }}
{{ with index . "ImageSize" }}
{{ .X }}×{{ .Y }}
@ -83,7 +87,6 @@
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if or (index . "Author") }}
{{ if index . "Author" }}

View File

@ -133,6 +133,7 @@ func (p *Parser) Parse(u *url.URL, referer *url.URL) (result parsers.ParseResult
"IsUpload": true,
"ImageSize": image.Point{X: m.Width, Y: m.Height},
"ImageType": strings.ToUpper(imgType),
"Title": u.Path[strings.LastIndex(u.Path, "/")+1:],
}
if resp.ContentLength > 0 {
info["Size"] = uint64(resp.ContentLength)