image.json 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. {
  2. "about": {
  3. "trial": false,
  4. "author": {
  5. "name": "EMQ",
  6. "email": "contact@emqx.io",
  7. "company": "EMQ Technologies Co., Ltd",
  8. "website": "https://www.emqx.io"
  9. },
  10. "helpUrl": {
  11. "en_US": "https://ekuiper.org/docs/en/latest/sqls/custom_functions.html",
  12. "zh_CN": "https://ekuiper.org/docs/zh/latest/sqls/custom_functions.html"
  13. },
  14. "description": {
  15. "en_US": "",
  16. "zh_CN": ""
  17. }
  18. },
  19. "libs": ["github.com/nfnt/resize@master"],
  20. "name": "image",
  21. "functions": [{
  22. "name": "resize",
  23. "example": "resize(image,width, height, isRaw)",
  24. "hint": {
  25. "en_US": "Creates a scaled image with new dimensions (width, height) .If either width or height is set to 0, it will be set to an aspect ratio preserving value.",
  26. "zh_CN": "创建具有新尺寸(宽度,高度)的缩放图像。如果width或height设置为0,则将其设置为长宽比保留值。"
  27. },
  28. "args": [
  29. {
  30. "name": "image",
  31. "hidden": true,
  32. "optional": false,
  33. "control": "text",
  34. "type": "string",
  35. "hint": {
  36. "en_US": "Input data",
  37. "zh_CN": "输入数据"
  38. },
  39. "label": {
  40. "en_US": "Input data",
  41. "zh_CN": "输入数据"
  42. }
  43. },{
  44. "name": "width",
  45. "hidden": true,
  46. "optional": false,
  47. "control": "text",
  48. "type": "int",
  49. "hint": {
  50. "en_US": "Input width",
  51. "zh_CN": "输入宽度"
  52. },
  53. "label": {
  54. "en_US": "Input width",
  55. "zh_CN": "输入宽度"
  56. }
  57. },{
  58. "name": "height",
  59. "hidden": true,
  60. "optional": false,
  61. "control": "text",
  62. "type": "int",
  63. "hint": {
  64. "en_US": "Input height",
  65. "zh_CN": "输入高度"
  66. },
  67. "label": {
  68. "en_US": "Input height",
  69. "zh_CN": "输入高度"
  70. }
  71. },{
  72. "name": "isRaw",
  73. "hidden": true,
  74. "optional": true,
  75. "control": "radio",
  76. "type": "bool",
  77. "hint": {
  78. "en_US": "Whether to output raw data, set to true when using by most AI inference",
  79. "zh_CN": "输出未编码原始数据,通常 AI 推断需要原始数据"
  80. },
  81. "label": {
  82. "en_US": "Output Raw Data",
  83. "zh_CN": "输出原始数据"
  84. }
  85. }
  86. ],
  87. "return": {
  88. "type": "bytea",
  89. "hint": {
  90. "en_US": "Resized image",
  91. "zh_CN": "缩放后的图像"
  92. }
  93. },
  94. "node": {
  95. "category": "function",
  96. "icon": "iconPath",
  97. "label": {
  98. "en_US": "resize",
  99. "zh_CN": "resize"
  100. }
  101. }
  102. }, {
  103. "name": "thumbnail",
  104. "example": "thumbnail(image,maxWidth, maxHeight)",
  105. "hint": {
  106. "en_US": "Downscales an image preserving its aspect ratio to the maximum dimensions (maxWidth, maxHeight).",
  107. "zh_CN": "将保留宽高比的图像缩小到最大尺寸(maxWidth,maxHeight)。"
  108. },
  109. "args": [
  110. {
  111. "name": "image",
  112. "hidden": true,
  113. "optional": false,
  114. "control": "text",
  115. "type": "string",
  116. "hint": {
  117. "en_US": "Input data",
  118. "zh_CN": "输入数据"
  119. },
  120. "label": {
  121. "en_US": "Input data",
  122. "zh_CN": "输入数据"
  123. }
  124. },{
  125. "name": "maxWidth",
  126. "hidden": true,
  127. "optional": false,
  128. "control": "text",
  129. "type": "int",
  130. "hint": {
  131. "en_US": "Input maxWidth",
  132. "zh_CN": "输入最大宽度"
  133. },
  134. "label": {
  135. "en_US": "Input maxWidth",
  136. "zh_CN": "输入最大宽度"
  137. }
  138. },{
  139. "name": "maxHeight",
  140. "hidden": true,
  141. "optional": false,
  142. "control": "text",
  143. "type": "int",
  144. "hint": {
  145. "en_US": "Input maxHeight",
  146. "zh_CN": "输入最大高度"
  147. },
  148. "label": {
  149. "en_US": "Input maxHeight",
  150. "zh_CN": "输入最大高度"
  151. }
  152. }
  153. ],
  154. "return": {
  155. "type": "bytea",
  156. "hint": {
  157. "en_US": "Thumbnail",
  158. "zh_CN": "缩略图"
  159. }
  160. },
  161. "node": {
  162. "category": "function",
  163. "icon": "iconPath",
  164. "label": {
  165. "en_US": "thumbnail",
  166. "zh_CN": "thumbnail"
  167. }
  168. }
  169. }]
  170. }