修改
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func MakeThumbnailDefault90(imagePath, savePath string) error {
|
func MakeThumbnailDefault270(imagePath, savePath string) error {
|
||||||
prefix := strings.ToLower(path.Ext("./2.jpg"))
|
prefix := strings.ToLower(path.Ext("./2.jpg"))
|
||||||
|
|
||||||
file, _ := os.Open(imagePath)
|
file, _ := os.Open(imagePath)
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HttpType = "http://"
|
HttpType = "http://"
|
||||||
HttpsType = "https://"
|
HttpsType = "https://"
|
||||||
TmpArtworkDir = "./runtime/tmp/artworks"
|
TmpArtworkDir = "./runtime/tmp/artworks"
|
||||||
TmpArtistDir = "./runtime/tmp/artists"
|
TmpArtistDir = "./runtime/tmp/artists"
|
||||||
MediaPath = "./runtime/"
|
MediaPath = "./runtime/"
|
||||||
TplPath = "./data/"
|
TplPath = "./data/"
|
||||||
ImgActionRotate = "rotate" //旋转
|
ImgActionRotate = "rotate" //旋转
|
||||||
ImgActionRotate90 = "rotate90" //旋转
|
ImgActionRotate270 = "rotate270" //旋转
|
||||||
MediaTypeVideo = "video"
|
MediaTypeVideo = "video"
|
||||||
MediaTypeImage = "video"
|
MediaTypeImage = "video"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -135,10 +135,10 @@ func UploadImg(c *gin.Context) {
|
|||||||
_ = os.Remove(dst)
|
_ = os.Remove(dst)
|
||||||
dst = newDst
|
dst = newDst
|
||||||
}
|
}
|
||||||
} else if action == model.ImgActionRotate90 {
|
} else if action == model.ImgActionRotate270 {
|
||||||
fileFullName = fmt.Sprintf("%s%s", filename, fileExt)
|
fileFullName = fmt.Sprintf("%s%s", filename, fileExt)
|
||||||
newDst := fmt.Sprintf("%s/%s_rotate%v", imgPath, 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)
|
fmt.Printf("MakeThumbnailDefault90 err %+v\n", err)
|
||||||
} else {
|
} else {
|
||||||
_ = os.Remove(dst)
|
_ = os.Remove(dst)
|
||||||
|
Loading…
Reference in New Issue
Block a user