Skip to content

Commit

Permalink
Keep fallback image generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzeller committed Sep 8, 2024
1 parent 1520125 commit 75ba471
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions stuff/image-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,15 @@ func (h *ImageHandler) serveComponentImage(requested galleryImage, out http.Resp
}

// No image, but let's see if we can do something from the
// part ID itself.
// part ID itself or the values the form passes to us.
component := h.store.FindById(requested.id)
if component != nil {
category := r.FormValue("c") // We also allow these if available
value := r.FormValue("v")
if (len(category) > 0 || len(value) > 0) &&
h.serveGeneratedComponentImage(component, category, value, out) {
return
}
if h.servePackageImage(component, out) {
return
}
category := r.FormValue("c") // We also allow these if available
value := r.FormValue("v")
if h.serveGeneratedComponentImage(component, category, value, out) {
return
}
if h.servePackageImage(component, out) {
return
}
sendResource(h.staticPath+"/fallback.png", "", out)
}
Expand Down

0 comments on commit 75ba471

Please sign in to comment.