mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
SQLite model refactoring, part 2 (#3839)
* Treat empty image input as null * Add validation to models.Date * Allow zero dates in database * Make scene_markers.scene_id non-nullable * Drop scraped_items table * Remove movie/studio checksum * Add migration notes --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,10 @@ const base64RE = `^data:.+\/(.+);base64,(.*)$`
|
||||
// ProcessImageInput transforms an image string either from a base64 encoded
|
||||
// string, or from a URL, and returns the image as a byte slice
|
||||
func ProcessImageInput(ctx context.Context, imageInput string) ([]byte, error) {
|
||||
if imageInput == "" {
|
||||
return []byte{}, nil
|
||||
}
|
||||
|
||||
regex := regexp.MustCompile(base64RE)
|
||||
if regex.MatchString(imageInput) {
|
||||
d, err := ProcessBase64Image(imageInput)
|
||||
|
||||
Reference in New Issue
Block a user