forked from soup-bowl/node-red-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsharp-convert.html
53 lines (51 loc) · 1.84 KB
/
sharp-convert.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
<script type="text/javascript">
RED.nodes.registerType('sharp-convert', {
category: 'sharp',
color: '#99cc00',
defaults: {
name: { value: "" },
format: { value: "jpeg" }
},
inputs: 1,
outputs: 1,
icon: "hash.svg",
label: function () {
return this.name || "sharp-convert";
}
});
</script>
<script type="text/html" data-template-name="sharp-convert">
<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-format">Format</label>
<select id="node-input-format" style="width: 70%;">
<option value="jpeg">JPEG (default)</option>
<option value="png">PNG</option>
<option value="webp">WEBP</option>
<option value="gif">GIF</option>
<option value="tiff">TIFF</option>
<option value="avif">AVIF</option>
<option value="heif">HEIF</option>
<option value="jxl">JXL</option>
<option value="raw">RAW</option>
</select>
</div>
<div class="form-tips" id="node-tip-1">
Tip: Options can be specified by passing an option for the destination format to <code>msg.sharp.options</code>.<br>
You can find more information on supported options <a href="https://sharp.pixelplumbing.com/api-output#jpeg">in
the Sharp Documentation</a> (jpeg used as example).
</div>
<br>
<div class="form-tips" id="node-tip-2">
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 format, it looks for <code>msg.sharp.format</code>.<br>
<strong>This is alpha, and may change at a later version.</strong>
</div>
</script>
<script type="text/html" data-help-name="sharp-convert">
<p>Runs an image through the Sharp library for conversion and adjustments</p>
</script>