added image proxy
This commit is contained in:
parent
33dbefcf6e
commit
8da8999802
5 changed files with 101 additions and 16 deletions
10
images.go
10
images.go
|
@ -69,11 +69,11 @@ func fetchImageResults(query string) ([]ImageSearchResult, error) {
|
|||
var results []ImageSearchResult
|
||||
for _, item := range apiResp.Data.Result.Items {
|
||||
results = append(results, ImageSearchResult{
|
||||
Thumbnail: item.Thumbnail, // Thumbnail URL
|
||||
Title: item.Title, // Image title
|
||||
Media: item.Media, // Direct link to the image - Ensure this field is used appropriately in your template
|
||||
Source: item.Media, // Using item.Media here ensures the direct image link is used
|
||||
ThumbProxy: "/img_proxy?url=" + url.QueryEscape(item.Thumbnail), // Proxy URL for the thumbnail, if needed
|
||||
Thumbnail: item.Thumbnail, // Thumbnail URL
|
||||
Title: item.Title, // Image title
|
||||
Media: item.Media, // Direct link to the image - Ensure this field is used appropriately in your template
|
||||
Source: item.Media, // Using item.Media here ensures the direct image link is used
|
||||
ThumbProxy: "/img_proxy?url=" + url.QueryEscape(item.Media), // Proxy URL for the thumbnail, if needed
|
||||
Width: item.Width,
|
||||
Height: item.Height,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue