修改
This commit is contained in:
parent
3e33992542
commit
cb09b07170
@ -172,7 +172,7 @@ func (u *Upload) PutBos(filePath string, mediaType string, needRemove bool) (url
|
||||
return
|
||||
}
|
||||
|
||||
func MakeThumbnailDefault90(imagePath, savePath string) error {
|
||||
func MakeThumbnailDefault270(imagePath, savePath string) error {
|
||||
prefix := strings.ToLower(path.Ext("./2.jpg"))
|
||||
|
||||
file, _ := os.Open(imagePath)
|
||||
|
@ -1,16 +1,16 @@
|
||||
package model
|
||||
|
||||
const (
|
||||
HttpType = "http://"
|
||||
HttpsType = "https://"
|
||||
TmpArtworkDir = "./runtime/tmp/artworks"
|
||||
TmpArtistDir = "./runtime/tmp/artists"
|
||||
MediaPath = "./runtime/"
|
||||
TplPath = "./data/"
|
||||
ImgActionRotate = "rotate" //旋转
|
||||
ImgActionRotate90 = "rotate90" //旋转
|
||||
MediaTypeVideo = "video"
|
||||
MediaTypeImage = "video"
|
||||
HttpType = "http://"
|
||||
HttpsType = "https://"
|
||||
TmpArtworkDir = "./runtime/tmp/artworks"
|
||||
TmpArtistDir = "./runtime/tmp/artists"
|
||||
MediaPath = "./runtime/"
|
||||
TplPath = "./data/"
|
||||
ImgActionRotate = "rotate" //旋转
|
||||
ImgActionRotate270 = "rotate270" //旋转
|
||||
MediaTypeVideo = "video"
|
||||
MediaTypeImage = "video"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -135,10 +135,10 @@ func UploadImg(c *gin.Context) {
|
||||
_ = os.Remove(dst)
|
||||
dst = newDst
|
||||
}
|
||||
} else if action == model.ImgActionRotate90 {
|
||||
} else if action == model.ImgActionRotate270 {
|
||||
fileFullName = fmt.Sprintf("%s%s", filename, fileExt)
|
||||
newDst := fmt.Sprintf("%s/%s_rotate%v", imgPath, filename, fileExt)
|
||||
if err = logic.MakeThumbnailDefault90(dst, newDst); err != nil {
|
||||
if err = logic.MakeThumbnailDefault270(dst, newDst); err != nil {
|
||||
fmt.Printf("MakeThumbnailDefault90 err %+v\n", err)
|
||||
} else {
|
||||
_ = os.Remove(dst)
|
||||
|
Loading…
Reference in New Issue
Block a user