@@ -33,6 +33,7 @@ type responseQuiqrsiteDictType struct {
33
33
QuiqrEtalageAuthorHomepage string
34
34
QuiqrEtalageScreenshots []string
35
35
Screenshot string
36
+ ScreenshotImageType string
36
37
}
37
38
38
39
@@ -78,7 +79,8 @@ func showCaseQuiqrsite(url string, skipBase64Screenshot bool){
78
79
var hugover string
79
80
var hugotheme string
80
81
formEndPoints := 0
81
- screenshot1 := ""
82
+ screenshotBase64 := ""
83
+ var screenshotBase64ImageType string
82
84
var quiqrModel string
83
85
var quiqrEtalageName string
84
86
var quiqrEtalageDescription string
@@ -133,9 +135,9 @@ func showCaseQuiqrsite(url string, skipBase64Screenshot bool){
133
135
if (strings .HasPrefix (f .Name , "quiqr/etalage/screenshots/" )){
134
136
quiqrEtalageScreenshots = append (quiqrEtalageScreenshots , f .Name )
135
137
136
- if (! skipBase64Screenshot && screenshot1 == "" ){
138
+ if (! skipBase64Screenshot && screenshotBase64 == "" ){
137
139
138
- imgExts := []string {"jpg" , "png" , "git " , "jpeg" }
140
+ imgExts := []string {"jpg" , "png" , "gif " , "jpeg" }
139
141
extension := strings .ToLower (strings .TrimLeft (filepath .Ext (f .Name ), "." ))
140
142
if (slices .Contains (imgExts , extension )){
141
143
//spew.Dump(f.Name)
@@ -149,12 +151,17 @@ func showCaseQuiqrsite(url string, skipBase64Screenshot bool){
149
151
switch mimeType {
150
152
case "image/jpeg" :
151
153
base64Encoding += "data:image/jpeg;base64,"
154
+ screenshotBase64ImageType = "jpg"
155
+ case "image/gif" :
156
+ base64Encoding += "data:image/gif;base64,"
157
+ screenshotBase64ImageType = "gif"
152
158
case "image/png" :
153
159
base64Encoding += "data:image/png;base64,"
160
+ screenshotBase64ImageType = "png"
154
161
}
155
162
156
163
base64Encoding += toBase64 (contentsBytes )
157
- screenshot1 = base64Encoding
164
+ screenshotBase64 = base64Encoding
158
165
}
159
166
}
160
167
}
@@ -177,12 +184,11 @@ func showCaseQuiqrsite(url string, skipBase64Screenshot bool){
177
184
})
178
185
179
186
responseDict := & responseQuiqrsiteDictType {
180
- HugoVersion : hugover ,
181
- HugoTheme : hugotheme ,
182
-
183
- QuiqrFormsEndPoints : formEndPoints ,
184
- QuiqrModel : quiqrModel ,
185
187
188
+ HugoVersion : hugover ,
189
+ HugoTheme : hugotheme ,
190
+ QuiqrFormsEndPoints : formEndPoints ,
191
+ QuiqrModel : quiqrModel ,
186
192
QuiqrEtalageName : quiqrEtalageName ,
187
193
QuiqrEtalageDescription : quiqrEtalageDescription ,
188
194
QuiqrEtalageHomepage : quiqrEtalageHomepage ,
@@ -192,8 +198,9 @@ func showCaseQuiqrsite(url string, skipBase64Screenshot bool){
192
198
QuiqrEtalageAuthor : quiqrEtalageAuthor ,
193
199
QuiqrEtalageAuthorHomepage : quiqrEtalageAuthorHomepage ,
194
200
QuiqrEtalageScreenshots : quiqrEtalageScreenshots ,
201
+ Screenshot : screenshotBase64 ,
202
+ ScreenshotImageType : screenshotBase64ImageType ,
195
203
196
- Screenshot : screenshot1 ,
197
204
}
198
205
responseJson , _ := json .Marshal (responseDict )
199
206
fmt .Println (string (responseJson ))
0 commit comments