Browse Source

Merge pull request #169 from qor5/fix-crop-with-hash-media-library-url

media: fix crop with hash MediaLibraryURL
xuxinx 1 year ago
parent
commit
522f0fe178
1 changed files with 2 additions and 1 deletions
  1. 2 1
      media/views/cropper.go

+ 2 - 1
media/views/cropper.go

@@ -3,11 +3,11 @@ package views
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/qor5/admin/presets"
 	"time"
 
 	"github.com/qor5/admin/media"
 	"github.com/qor5/admin/media/media_library"
+	"github.com/qor5/admin/presets"
 	"github.com/qor5/ui/cropper"
 	. "github.com/qor5/ui/vuetify"
 	"github.com/qor5/web"
@@ -143,6 +143,7 @@ func cropImage(db *gorm.DB) web.EventFunc {
 				return r, nil
 			}
 
+			mb.Url = m.File.Url
 			mb.FileSizes = m.File.FileSizes
 			if thumb == media.DefaultSizeKey {
 				mb.Width = int(cropValue.Width)