Browse Source

Better processing options logging

DarthSim 6 years ago
parent
commit
0eb96b0b42
1 changed files with 27 additions and 0 deletions
  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