forked from soup-bowl/node-red-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sharp-resize.html
83 lines (81 loc) · 2.75 KB
/
sharp-resize.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<script type="text/javascript">
RED.nodes.registerType('sharp-resize',{
category: 'sharp',
color: '#99cc00',
defaults: {
name: {value:""},
width: {value:0},
height: {value:0},
fit: {value:"cover"},
position: {value:"centre"},
gravity: {value:"centre"}
},
inputs: 1,
outputs: 1,
icon: "hash.svg",
label: function() {
return this.name||"sharp-resize";
}
});
</script>
<script type="text/html" data-template-name="sharp-resize">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-width">Width</label>
<input type="number" id="node-input-width">
</div>
<div class="form-row">
<label for="node-input-height">Height</label>
<input type="number" id="node-input-height">
</div>
<div class="form-row">
<label for="node-input-fit">Fit</label>
<select id="node-input-fit" style="width: 70%;">
<option value="cover">Cover (default)</option>
<option value="contain">Contain</option>
<option value="fill">Fill</option>
<option value="inside">Inside</option>
<option value="outside">Outside</option>
</select>
</div>
<div class="form-row">
<label for="node-input-position">Position</label>
<select id="node-input-position" style="width: 70%;">
<option value="centre">Centre (default)</option>
<option value="top">Top</option>
<option value="right top">Right Top</option>
<option value="right">Right</option>
<option value="right bottom">Right Bottom</option>
<option value="bottom">Bottom</option>
<option value="left bottom">Left Bottom</option>
<option value="left">Left</option>
<option value="left top">Left Top</option>
</select>
</div>
<!--<div class="form-row">
<label for="node-input-gravity">Gravity</label>
<select id="node-input-gravity">
<option value="centre">Centre (default)</option>
<option value="north">North</option>
<option value="northeast">Northeast</option>
<option value="east">East</option>
<option value="southeast">Southeast</option>
<option value="south">South</option>
<option value="southwest">Southwest</option>
<option value="west">West</option>
<option value="northwest">Northwest</option>
</select>
</div>-->
<div class="form-tips" id="node-tip">
Tip: For Sharp arguments, the node will accept flow arguments over inputs.<br>
Arguments are the same name, but stored within <code>msg.sharp</code> object.<br>
e.g. for width, it looks for <code>msg.sharp.width</code>.<br>
<strong>This is alpha, and may change at a later version.</strong>
</div>
</script>
<script type="text/html" data-help-name="sharp-resize">
<p>Allows for resizing of a binary buffer image payload.</p>
</script>