image.json 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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/functions/custom_functions.html",
  12. "zh_CN": "https://ekuiper.org/docs/zh/latest/sqls/functions/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": false,
  32. "optional": false,
  33. "control": "field",
  34. "type": "string",
  35. "hint": {
  36. "en_US": "Input image",
  37. "zh_CN": "输入图像"
  38. },
  39. "label": {
  40. "en_US": "Image",
  41. "zh_CN": "图像"
  42. }
  43. },{
  44. "name": "width",
  45. "optional": false,
  46. "control": "text",
  47. "type": "int",
  48. "hint": {
  49. "en_US": "Input width",
  50. "zh_CN": "输入宽度"
  51. },
  52. "label": {
  53. "en_US": "Width",
  54. "zh_CN": "宽度"
  55. }
  56. },{
  57. "name": "height",
  58. "optional": false,
  59. "control": "text",
  60. "type": "int",
  61. "hint": {
  62. "en_US": "Input height",
  63. "zh_CN": "输入高度"
  64. },
  65. "label": {
  66. "en_US": "Height",
  67. "zh_CN": "高度"
  68. }
  69. },{
  70. "name": "isRaw",
  71. "optional": true,
  72. "control": "radio",
  73. "type": "bool",
  74. "hint": {
  75. "en_US": "Whether to output raw data, set to true when using by most AI inference",
  76. "zh_CN": "输出未编码原始数据,通常 AI 推断需要原始数据"
  77. },
  78. "label": {
  79. "en_US": "Output Raw Data",
  80. "zh_CN": "输出原始数据"
  81. }
  82. }
  83. ],
  84. "return": {
  85. "type": "bytea",
  86. "hint": {
  87. "en_US": "Resized image",
  88. "zh_CN": "缩放后的图像"
  89. }
  90. },
  91. "node": {
  92. "category": "function",
  93. "icon": "iconPath",
  94. "label": {
  95. "en_US": "Image Resize",
  96. "zh_CN": "图像调整大小"
  97. }
  98. }
  99. }, {
  100. "name": "thumbnail",
  101. "example": "thumbnail(image,maxWidth, maxHeight)",
  102. "hint": {
  103. "en_US": "Downscales an image preserving its aspect ratio to the maximum dimensions (maxWidth, maxHeight).",
  104. "zh_CN": "将保留宽高比的图像缩小到最大尺寸(maxWidth,maxHeight)。"
  105. },
  106. "args": [
  107. {
  108. "name": "image",
  109. "hidden": false,
  110. "optional": false,
  111. "control": "field",
  112. "type": "string",
  113. "hint": {
  114. "en_US": "Input image",
  115. "zh_CN": "输入图像"
  116. },
  117. "label": {
  118. "en_US": "Image",
  119. "zh_CN": "图像"
  120. }
  121. },{
  122. "name": "maxWidth",
  123. "optional": false,
  124. "control": "text",
  125. "type": "int",
  126. "hint": {
  127. "en_US": "Input maxWidth",
  128. "zh_CN": "输入最大宽度"
  129. },
  130. "label": {
  131. "en_US": "Max Width",
  132. "zh_CN": "最大宽度"
  133. }
  134. },{
  135. "name": "maxHeight",
  136. "optional": false,
  137. "control": "text",
  138. "type": "int",
  139. "hint": {
  140. "en_US": "Input maxHeight",
  141. "zh_CN": "输入最大高度"
  142. },
  143. "label": {
  144. "en_US": "MaxHeight",
  145. "zh_CN": "最大高度"
  146. }
  147. }
  148. ],
  149. "return": {
  150. "type": "bytea",
  151. "hint": {
  152. "en_US": "Thumbnail",
  153. "zh_CN": "缩略图"
  154. }
  155. },
  156. "node": {
  157. "category": "function",
  158. "icon": "iconPath",
  159. "label": {
  160. "en_US": "Thumbnail",
  161. "zh_CN": "缩略图"
  162. }
  163. }
  164. }]
  165. }