1syntax = "proto2"; 2option go_package = "image"; 3 4package appengine; 5 6message ImagesServiceError { 7 enum ErrorCode { 8 UNSPECIFIED_ERROR = 1; 9 BAD_TRANSFORM_DATA = 2; 10 NOT_IMAGE = 3; 11 BAD_IMAGE_DATA = 4; 12 IMAGE_TOO_LARGE = 5; 13 INVALID_BLOB_KEY = 6; 14 ACCESS_DENIED = 7; 15 OBJECT_NOT_FOUND = 8; 16 } 17} 18 19message ImagesServiceTransform { 20 enum Type { 21 RESIZE = 1; 22 ROTATE = 2; 23 HORIZONTAL_FLIP = 3; 24 VERTICAL_FLIP = 4; 25 CROP = 5; 26 IM_FEELING_LUCKY = 6; 27 } 28} 29 30message Transform { 31 optional int32 width = 1; 32 optional int32 height = 2; 33 optional bool crop_to_fit = 11 [default = false]; 34 optional float crop_offset_x = 12 [default = 0.5]; 35 optional float crop_offset_y = 13 [default = 0.5]; 36 37 optional int32 rotate = 3 [default = 0]; 38 39 optional bool horizontal_flip = 4 [default = false]; 40 41 optional bool vertical_flip = 5 [default = false]; 42 43 optional float crop_left_x = 6 [default = 0.0]; 44 optional float crop_top_y = 7 [default = 0.0]; 45 optional float crop_right_x = 8 [default = 1.0]; 46 optional float crop_bottom_y = 9 [default = 1.0]; 47 48 optional bool autolevels = 10 [default = false]; 49 50 optional bool allow_stretch = 14 [default = false]; 51} 52 53message ImageData { 54 required bytes content = 1 [ctype=CORD]; 55 optional string blob_key = 2; 56 57 optional int32 width = 3; 58 optional int32 height = 4; 59} 60 61message InputSettings { 62 enum ORIENTATION_CORRECTION_TYPE { 63 UNCHANGED_ORIENTATION = 0; 64 CORRECT_ORIENTATION = 1; 65 } 66 optional ORIENTATION_CORRECTION_TYPE correct_exif_orientation = 1 67 [default=UNCHANGED_ORIENTATION]; 68 optional bool parse_metadata = 2 [default=false]; 69 optional int32 transparent_substitution_rgb = 3; 70} 71 72message OutputSettings { 73 enum MIME_TYPE { 74 PNG = 0; 75 JPEG = 1; 76 WEBP = 2; 77 } 78 79 optional MIME_TYPE mime_type = 1 [default=PNG]; 80 optional int32 quality = 2; 81} 82 83message ImagesTransformRequest { 84 required ImageData image = 1; 85 repeated Transform transform = 2; 86 required OutputSettings output = 3; 87 optional InputSettings input = 4; 88} 89 90message ImagesTransformResponse { 91 required ImageData image = 1; 92 optional string source_metadata = 2; 93} 94 95message CompositeImageOptions { 96 required int32 source_index = 1; 97 required int32 x_offset = 2; 98 required int32 y_offset = 3; 99 required float opacity = 4; 100 101 enum ANCHOR { 102 TOP_LEFT = 0; 103 TOP = 1; 104 TOP_RIGHT = 2; 105 LEFT = 3; 106 CENTER = 4; 107 RIGHT = 5; 108 BOTTOM_LEFT = 6; 109 BOTTOM = 7; 110 BOTTOM_RIGHT = 8; 111 } 112 113 required ANCHOR anchor = 5; 114} 115 116message ImagesCanvas { 117 required int32 width = 1; 118 required int32 height = 2; 119 required OutputSettings output = 3; 120 optional int32 color = 4 [default=-1]; 121} 122 123message ImagesCompositeRequest { 124 repeated ImageData image = 1; 125 repeated CompositeImageOptions options = 2; 126 required ImagesCanvas canvas = 3; 127} 128 129message ImagesCompositeResponse { 130 required ImageData image = 1; 131} 132 133message ImagesHistogramRequest { 134 required ImageData image = 1; 135} 136 137message ImagesHistogram { 138 repeated int32 red = 1; 139 repeated int32 green = 2; 140 repeated int32 blue = 3; 141} 142 143message ImagesHistogramResponse { 144 required ImagesHistogram histogram = 1; 145} 146 147message ImagesGetUrlBaseRequest { 148 required string blob_key = 1; 149 150 optional bool create_secure_url = 2 [default = false]; 151} 152 153message ImagesGetUrlBaseResponse { 154 required string url = 1; 155} 156 157message ImagesDeleteUrlBaseRequest { 158 required string blob_key = 1; 159} 160 161message ImagesDeleteUrlBaseResponse { 162} 163