소스 검색

Better processing options logging

DarthSim 7 년 전
부모
커밋
0eb96b0b42
1개의 변경된 파일27개의 추가작업 그리고 0개의 파일을 삭제
  1. 27 0
      processing_options.go

+ 27 - 0
processing_options.go

@@ -87,6 +87,33 @@ type processingOptions struct {
 	Sharpen float32
 }
 
+func (it imageType) String() string {
+	for k, v := range imageTypes {
+		if v == it {
+			return k
+		}
+	}
+	return ""
+}
+
+func (gt gravityType) String() string {
+	for k, v := range gravityTypes {
+		if v == gt {
+			return k
+		}
+	}
+	return ""
+}
+
+func (rt resizeType) String() string {
+	for k, v := range resizeTypes {
+		if v == rt {
+			return k
+		}
+	}
+	return ""
+}
+
 func decodeURL(parts []string) (string, imageType, error) {
 	var imgType imageType = imageTypeJPEG