This commit is contained in:
蒋海成 2025-02-24 18:34:46 +08:00
parent 3e33992542
commit cb09b07170
3 changed files with 13 additions and 13 deletions

View File

@ -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)

View File

@ -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 (

View File

@ -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)