mirror of
https://github.com/stashapp/stash.git
synced 2026-02-04 01:52:43 -06:00
fix(scraper): handle base64 data URIs in processImageField (#6480)
Add check to skip HTTP fetch for non-HTTP URLs in processImageField(), matching the existing behavior in setPerformerImage() and setStudioImage(). This allows scrapers to return base64 data URIs (e.g., `data:image/jpeg;base64,...`) directly without triggering an HTTP fetch error. Previously, processImageField() would attempt to create an HTTP request with the data URI as the URL, causing "Could not set image using URL" warnings.
This commit is contained in:
parent
fa80454891
commit
c0260781a5
@ -68,6 +68,12 @@ func processImageField(ctx context.Context, imageField *string, client *http.Cli
|
||||
return nil
|
||||
}
|
||||
|
||||
// don't try to get the image if it doesn't appear to be a URL
|
||||
// this allows scrapers to return base64 data URIs directly
|
||||
if !strings.HasPrefix(*imageField, "http") {
|
||||
return nil
|
||||
}
|
||||
|
||||
img, err := getImage(ctx, *imageField, client, globalConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user