@lee-jisoo/n8n-nodes-mediafx 1.6.24 → 1.6.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,6 +10,13 @@ This is a custom n8n node for comprehensive, local media processing using FFmpeg
10
10
 
11
11
  ## 🆕 What's New in This Fork
12
12
 
13
+ ### v1.6.25
14
+ **New Features**
15
+
16
+ - **📝 Multi-line Text Alignment**: Added text alignment option for Add Text to Image
17
+ - Left, Center, Right alignment for multi-line text
18
+ - Useful when text contains line breaks (`\n`)
19
+
13
20
  ### v1.6.24
14
21
  **Bug Fixes**
15
22
 
@@ -418,6 +418,7 @@ class MediaFX {
418
418
  fontKey: this.getNodeParameter('imageTextFontKey', i, 'noto-sans-kr'),
419
419
  size: this.getNodeParameter('imageTextSize', i, 48),
420
420
  color: this.getNodeParameter('imageTextColor', i, 'white'),
421
+ textAlign: this.getNodeParameter('imageTextAlign', i, 'left'),
421
422
  outlineWidth: this.getNodeParameter('imageTextOutlineWidth', i, 0),
422
423
  outlineColor: this.getNodeParameter('imageTextOutlineColor', i, 'black'),
423
424
  enableBackground: this.getNodeParameter('imageTextEnableBackground', i, false),
@@ -96,6 +96,7 @@ async function executeAddTextToImage(imagePath, text, options, itemIndex) {
96
96
  // Set default values for text options
97
97
  const fontSize = options.size || 48;
98
98
  const fontColor = options.color || 'white';
99
+ const textAlign = options.textAlign || 'left';
99
100
  // Outline options
100
101
  const outlineWidth = options.outlineWidth || 0;
101
102
  const outlineColor = options.outlineColor || 'black';
@@ -138,8 +139,11 @@ async function executeAddTextToImage(imagePath, text, options, itemIndex) {
138
139
  const outputPath = (0, utils_1.getTempFile)(outputExt);
139
140
  // Escape single quotes in text
140
141
  const escapedText = text.replace(/'/g, `''`);
142
+ // Map text alignment to FFmpeg format (L=left, C=center, R=right)
143
+ const textAlignMap = { left: 'L', center: 'C', right: 'R' };
144
+ const ffmpegTextAlign = textAlignMap[textAlign] || 'L';
141
145
  // Build drawtext filter
142
- let drawtext = `drawtext=fontfile=${fontPath}:text='${escapedText}':fontsize=${fontSize}:fontcolor=${fontColor}:x=${positionX}:y=${positionY}`;
146
+ let drawtext = `drawtext=fontfile=${fontPath}:text='${escapedText}':fontsize=${fontSize}:fontcolor=${fontColor}:x=${positionX}:y=${positionY}:text_align=${ffmpegTextAlign}`;
143
147
  // Add outline (border) if width > 0
144
148
  if (outlineWidth > 0) {
145
149
  drawtext += `:borderw=${outlineWidth}:bordercolor=${outlineColor}`;
@@ -122,6 +122,24 @@ exports.imageProperties = [
122
122
  },
123
123
  description: 'Text color (e.g., white, #FF0000, rgb(255,0,0))',
124
124
  },
125
+ {
126
+ displayName: 'Text Alignment (Multi-line)',
127
+ name: 'imageTextAlign',
128
+ type: 'options',
129
+ options: [
130
+ { name: 'Left', value: 'left' },
131
+ { name: 'Center', value: 'center' },
132
+ { name: 'Right', value: 'right' },
133
+ ],
134
+ default: 'left',
135
+ displayOptions: {
136
+ show: {
137
+ resource: ['image'],
138
+ operation: ['addTextToImage'],
139
+ },
140
+ },
141
+ description: 'Text alignment for multi-line text (when text contains line breaks)',
142
+ },
125
143
  {
126
144
  displayName: 'Outline Width',
127
145
  name: 'imageTextOutlineWidth',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lee-jisoo/n8n-nodes-mediafx",
3
- "version": "1.6.24",
3
+ "version": "1.6.25",
4
4
  "description": "N8N custom nodes for video editing and media processing (Enhanced fork with Speed control and Subtitle fixes)",
5
5
  "license": "MIT",
6
6
  "author": {