From 6b36e027f6ca0cccc00da5e83665732a291d3152 Mon Sep 17 00:00:00 2001 From: L-Yang <1554623806@qq.com> Date: Fri, 7 Aug 2026 15:50:48 +0800 Subject: [PATCH 01/33] fix(sum): treat the advertised line-break delimiter as a real newline The Sum tool exposes a literal "\n" as the default line-break separator and ships multiline examples using it, but passes the two literal characters straight into String.split. As a result, multiline input such as: 1 2 sums to 0 instead of 3. Normalize the literal "\n" separator to an actual newline before splitting, and add unit tests covering the multiline sum and running-sum cases. Closes #416 --- src/pages/tools/number/sum/service.ts | 5 ++++- src/pages/tools/number/sum/sum.service.test.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pages/tools/number/sum/service.ts b/src/pages/tools/number/sum/service.ts index 19cd9684..992af840 100644 --- a/src/pages/tools/number/sum/service.ts +++ b/src/pages/tools/number/sum/service.ts @@ -16,7 +16,10 @@ export const compute = ( if (extractionType === 'smart') { numbers = getAllNumbers(input); } else { - const parts = input.split(separator); + // The UI advertises a literal "\n" option as a line break; normalize it to an actual newline + // so multiline inputs split correctly instead of being treated as a single part. + const normalizedSeparator = separator.replace(/\\n/g, '\n'); + const parts = input.split(normalizedSeparator); // Filter out and convert parts that are numbers numbers = parts .filter((part) => !isNaN(Number(part)) && part.trim() !== '') diff --git a/src/pages/tools/number/sum/sum.service.test.ts b/src/pages/tools/number/sum/sum.service.test.ts index 944a28a9..c576fcb7 100644 --- a/src/pages/tools/number/sum/sum.service.test.ts +++ b/src/pages/tools/number/sum/sum.service.test.ts @@ -61,4 +61,16 @@ describe('compute function', () => { const result = compute(input, 'delimiter', false, ';'); expect(result).toBe('13'); }); + + it('should treat a literal \\n separator as a real line break (multiline sum)', () => { + const input = '1\n2\n4'; + const result = compute(input, 'delimiter', false, '\\n'); + expect(result).toBe('7'); + }); + + it('should return running sum with a literal \\n separator', () => { + const input = '1\n2\n4'; + const result = compute(input, 'delimiter', true, '\\n'); + expect(result).toBe('1\n3\n7\n'); + }); }); From 3e0817f1c65c1b458012ced78ab8d48b705e11e2 Mon Sep 17 00:00:00 2001 From: L-Yang <1554623806@qq.com> Date: Fri, 7 Aug 2026 16:18:17 +0800 Subject: [PATCH 02/33] fix(csv): drop blank lines in rows-to-columns as documented The tool's docs and its embedded example state that empty lines are removed during conversion, but blank input lines survived: splitting an empty line on commas yields [""] which passes the old `row.length > 0` filter, so blank lines showed up as empty output columns. Filter out rows that consist of a single empty field (a blank line), while still keeping legitimate rows with an empty first field (e.g. ",a"). Fixes #418 --- .../csv-rows-to-columns.service.test.ts | 12 ++++++++++++ src/pages/tools/csv/csv-rows-to-columns/service.ts | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/pages/tools/csv/csv-rows-to-columns/csv-rows-to-columns.service.test.ts b/src/pages/tools/csv/csv-rows-to-columns/csv-rows-to-columns.service.test.ts index 7faf0e7f..6cb849ea 100644 --- a/src/pages/tools/csv/csv-rows-to-columns/csv-rows-to-columns.service.test.ts +++ b/src/pages/tools/csv/csv-rows-to-columns/csv-rows-to-columns.service.test.ts @@ -58,4 +58,16 @@ describe('csvRowsToColumns', () => { 'Variety,Arabica,Robusta,Liberica,Mocha\nOrigin,Ethiopia,Africa,Philippines,1x' ); }); + + it('should remove blank lines', () => { + const input = 'a,b\n\n1,2\n\nx,y'; + const result = csvRowsToColumns(input, false, '', '#'); + expect(result).toBe('a,1,x\nb,2,y'); + }); + + it('should remove lines that contain only whitespace', () => { + const input = 'a,b\n \n1,2'; + const result = csvRowsToColumns(input, false, '', '#'); + expect(result).toBe('a,1\nb,2'); + }); }); diff --git a/src/pages/tools/csv/csv-rows-to-columns/service.ts b/src/pages/tools/csv/csv-rows-to-columns/service.ts index 614043fc..005fd643 100644 --- a/src/pages/tools/csv/csv-rows-to-columns/service.ts +++ b/src/pages/tools/csv/csv-rows-to-columns/service.ts @@ -25,7 +25,9 @@ export function csvRowsToColumns( .split('\n') .map((row) => row.split(',')) .filter( - (row) => row.length > 0 && !row[0].trim().startsWith(commentCharacter) + (row) => + !(row.length === 1 && row[0].trim() === '') && + !row[0].trim().startsWith(commentCharacter) ); const columnCount = Math.max(...rows.map((row) => row.length)); for (let i = 0; i < rows.length; i++) { From 9061ef3de7a0e451c5c016e90ad6e52725227bf2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 14 Aug 2026 20:41:08 -0500 Subject: [PATCH 03/33] fix: rename 'Import from file' button to 'Select files' for clarity --- public/locales/en/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 5b4efe41..70838cf7 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -115,7 +115,7 @@ "inputFooter": { "clear": "Clear", "copyToClipboard": "Copy to clipboard", - "importFromFile": "Import from file" + "importFromFile": "Select files" }, "list": { "group": { From 1ce464106bacc847753c508b414d1cd43749ca5b Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 14 Aug 2026 21:37:25 -0500 Subject: [PATCH 04/33] fix: show loading indicator while GIF is being generated --- src/pages/tools/video/gif/images-to-gif/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/tools/video/gif/images-to-gif/index.tsx b/src/pages/tools/video/gif/images-to-gif/index.tsx index de510c17..0dd01917 100644 --- a/src/pages/tools/video/gif/images-to-gif/index.tsx +++ b/src/pages/tools/video/gif/images-to-gif/index.tsx @@ -28,6 +28,7 @@ export default function ImagesToGif({ title }: ToolComponentProps) { input: MultiImageInput[] ) => { if (!input || input.length === 0) return; + setLoading(true); try { const convertedGif = await imagesToGif( input.map((item) => item.file), From a45ee6291e971748c5adc16415b98f61070e9253 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 15 Aug 2026 10:48:05 -0500 Subject: [PATCH 05/33] feat: add FPS input for GIF frame delay --- public/locales/en/video.json | 3 +- .../tools/video/gif/images-to-gif/index.tsx | 49 +++++++++++++------ 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/public/locales/en/video.json b/public/locales/en/video.json index 124e1761..d5d8b7ae 100644 --- a/public/locales/en/video.json +++ b/public/locales/en/video.json @@ -111,7 +111,8 @@ "resultTitle": "Animated GIF", "loadingText": "Creating GIF...", "frameOptions": "Frame Options", - "frameDelayDescription": "How long each frame is displayed, in milliseconds (e.g. 500 = 0.5 s per frame)" + "frameDelayDescription": "How long each frame is displayed, in milliseconds (e.g. 500 = 0.5 s per frame)", + "frameDelayMStoFPS": "Alternative way to set frame delay, in frames per second" } }, "loop": { diff --git a/src/pages/tools/video/gif/images-to-gif/index.tsx b/src/pages/tools/video/gif/images-to-gif/index.tsx index 0dd01917..e38676d4 100644 --- a/src/pages/tools/video/gif/images-to-gif/index.tsx +++ b/src/pages/tools/video/gif/images-to-gif/index.tsx @@ -71,22 +71,39 @@ export default function ImagesToGif({ title }: ToolComponentProps) { { title: t('gif.imagesToGif.frameOptions'), component: ( - - { - const clamped = Math.min( - 10000, - Math.max(50, Number(value)) - ).toString(); - updateNumberField(clamped, 'frameDelay', updateField); - }} - value={values.frameDelay} - /> - + <> + + { + const clamped = Math.min( + 10000, + Math.max(50, Number(value)) + ).toString(); + updateNumberField(clamped, 'frameDelay', updateField); + }} + value={values.frameDelay} + /> + + + { + const fps = Math.min(60, Math.max(1, Number(value))); + const ms = 1000 / fps; + const msString = ms.toString(); + updateNumberField(msString, 'frameDelay', updateField); + }} + value={1000 / values.frameDelay} + /> + + ) } ]} From b4843d29f3f93a60bccfb663096eb28e8547ba6a Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 16 Aug 2026 16:23:09 -0500 Subject: [PATCH 06/33] feat: support drag-and-drop for image file input --- .../input/ToolMultipleImageInput.tsx | 71 +++++++++++-------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/src/components/input/ToolMultipleImageInput.tsx b/src/components/input/ToolMultipleImageInput.tsx index 6804caad..080859e3 100644 --- a/src/components/input/ToolMultipleImageInput.tsx +++ b/src/components/input/ToolMultipleImageInput.tsx @@ -37,36 +37,7 @@ export default function ToolMultiImageInput({ const files = event.target.files; if (!files) return; - const newFiles: MultiImageInput[] = await Promise.all( - Array.from(files).map(async (file, index) => { - let processedFile = file; - - try { - if (await isHeic(file)) { - const convertedBlob = await heicTo({ - blob: file, - type: 'image/jpeg' - }); - - processedFile = new File( - [convertedBlob], - file.name.replace(/\.[^/.]+$/, '') + '.jpg', - { type: 'image/jpeg' } - ); - } - } catch (err) { - console.warn('HEIC conversion failed:', file.name, err); - } - - return { - file: processedFile, - order: value.length + index, - preview: URL.createObjectURL(processedFile) - }; - }) - ); - - onChange([...value, ...newFiles]); + await processFiles(Array.from(files)); event.target.value = ''; }; @@ -99,6 +70,44 @@ export default function ToolMultiImageInput({ : fileName; } + const processFiles = async (files: File[]) => { + const newFiles: MultiImageInput[] = await Promise.all( + Array.from(files).map(async (file, index) => { + let processedFile = file; + + try { + if (await isHeic(file)) { + const convertedBlob = await heicTo({ + blob: file, + type: 'image/jpeg' + }); + processedFile = new File( + [convertedBlob], + file.name.replace(/\.[^/.]+$/, '') + '.jpg', + { type: 'image/jpeg' } + ); + } + } catch (err) { + console.warn('HEIC conversion failed:', file.name, err); + } + + return { + file: processedFile, + order: value.length + index, + preview: URL.createObjectURL(processedFile) + }; + }) + ); + + onChange([...value, ...newFiles]); + }; + + const handleDrop = (e: React.DragEvent) => { + e.preventDefault(); + const files = e.dataTransfer.files; + processFiles(Array.from(files)); + }; + return ( ) => e.preventDefault()} + onDrop={handleDrop} > Date: Sun, 16 Aug 2026 23:16:28 -0700 Subject: [PATCH 07/33] fix(xml): preserve attributes when beautifying --- src/pages/tools/xml/xml-beautifier/service.ts | 8 ++++++-- .../xml/xml-beautifier/xml-beautifier.service.test.ts | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/pages/tools/xml/xml-beautifier/service.ts b/src/pages/tools/xml/xml-beautifier/service.ts index 8da42624..4fa512ad 100644 --- a/src/pages/tools/xml/xml-beautifier/service.ts +++ b/src/pages/tools/xml/xml-beautifier/service.ts @@ -13,9 +13,13 @@ export function beautifyXml( return 'Invalid XML'; } try { - const parser = new XMLParser(); + const parser = new XMLParser({ ignoreAttributes: false }); const obj = parser.parse(input); - const builder = new XMLBuilder({ format: true, indentBy: ' ' }); + const builder = new XMLBuilder({ + format: true, + indentBy: ' ', + ignoreAttributes: false + }); return builder.build(obj); } catch (e: any) { return `Invalid XML: ${e.message}`; diff --git a/src/pages/tools/xml/xml-beautifier/xml-beautifier.service.test.ts b/src/pages/tools/xml/xml-beautifier/xml-beautifier.service.test.ts index e832bb81..349744f9 100644 --- a/src/pages/tools/xml/xml-beautifier/xml-beautifier.service.test.ts +++ b/src/pages/tools/xml/xml-beautifier/xml-beautifier.service.test.ts @@ -10,6 +10,13 @@ describe('xml-beautifier', () => { expect(result).toContain(' 2'); }); + it('preserves attributes while beautifying XML', () => { + const input = 'Alice'; + const result = beautifyXml(input, {}); + + expect(result).toContain('Alice'); + }); + it('returns error for invalid XML', () => { const input = '1'; const result = beautifyXml(input, {}); From f9347212a905cf36f2cc00947901bde6d7403010 Mon Sep 17 00:00:00 2001 From: Sushanth012 Date: Sun, 16 Aug 2026 23:17:41 -0700 Subject: [PATCH 08/33] fix(list): compare full strings in case-sensitive sort --- src/pages/tools/list/sort/service.ts | 2 +- src/pages/tools/list/sort/sort.service.test.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/tools/list/sort/service.ts b/src/pages/tools/list/sort/service.ts index f6fb5fa8..c6d2895c 100644 --- a/src/pages/tools/list/sort/service.ts +++ b/src/pages/tools/list/sort/service.ts @@ -60,7 +60,7 @@ function customAlphabeticSort( return a.toLowerCase().localeCompare(b.toLowerCase()); } else { // Case-sensitive comparison - return a.charCodeAt(0) - b.charCodeAt(0); + return a === b ? 0 : a < b ? -1 : 1; } } diff --git a/src/pages/tools/list/sort/sort.service.test.ts b/src/pages/tools/list/sort/sort.service.test.ts index 3becba4d..d90afec1 100644 --- a/src/pages/tools/list/sort/sort.service.test.ts +++ b/src/pages/tools/list/sort/sort.service.test.ts @@ -183,6 +183,12 @@ describe('numericSort function', () => { }); // CASE SENSITIVE TEST + it('should compare the full string when prefixes match', () => { + const result = alphabeticSort(['az', 'aa'], true, ',', false, true); + + expect(result).toBe('aa,az'); + }); + it('should sort a list of string (uppercase) in decreasing order with comma separator ', () => { const array: string[] = ['Apple', 'Pineaple', 'Lemon', 'Orange']; const increasing: boolean = false; From 10c1e36873720b7aa451bb4e75f7991c7f485df9 Mon Sep 17 00:00:00 2001 From: Sushanth012 Date: Tue, 18 Aug 2026 23:35:31 -0700 Subject: [PATCH 09/33] fix(image): preserve EXIF metadata during compression --- .../generic/compress/compress.service.test.ts | 28 +++++++++++++++++++ .../tools/image/generic/compress/service.ts | 1 + 2 files changed, 29 insertions(+) create mode 100644 src/pages/tools/image/generic/compress/compress.service.test.ts diff --git a/src/pages/tools/image/generic/compress/compress.service.test.ts b/src/pages/tools/image/generic/compress/compress.service.test.ts new file mode 100644 index 00000000..fe374380 --- /dev/null +++ b/src/pages/tools/image/generic/compress/compress.service.test.ts @@ -0,0 +1,28 @@ +import { beforeEach, describe, expect, it, vi } from 'vitest'; +import imageCompression from 'browser-image-compression'; +import { compressImages } from './service'; + +vi.mock('browser-image-compression', () => ({ + default: vi.fn() +})); + +describe('compressImages', () => { + beforeEach(() => { + vi.mocked(imageCompression).mockResolvedValue( + new File(['compressed'], 'photo.jpg', { type: 'image/jpeg' }) + ); + }); + + it('preserves JPEG EXIF metadata while compressing', async () => { + const input = new File(['original'], 'photo.jpg', { + type: 'image/jpeg' + }); + + await compressImages([input], { maxFileSizeInMB: 1, quality: 80 }); + + expect(imageCompression).toHaveBeenCalledWith( + input, + expect.objectContaining({ preserveExif: true }) + ); + }); +}); diff --git a/src/pages/tools/image/generic/compress/service.ts b/src/pages/tools/image/generic/compress/service.ts index 3b3afe80..6b6178e5 100644 --- a/src/pages/tools/image/generic/compress/service.ts +++ b/src/pages/tools/image/generic/compress/service.ts @@ -14,6 +14,7 @@ export const compressImages = async ( maxSizeMB: maxFileSizeInMB, maxWidthOrHeight: 1920, // Reasonable default for most use cases useWebWorker: true, + preserveExif: true, initialQuality: quality / 100 // Convert percentage to decimal }; From ca8cf2b4b9d08d5ab073829ccd59a7bb9243bdb8 Mon Sep 17 00:00:00 2001 From: bdmohammed Date: Wed, 26 Aug 2026 15:34:28 +0530 Subject: [PATCH 10/33] feat(image): add background color selection to opacity tool (#105) --- .../image/generic/change-opacity/index.tsx | 38 +++++++++++++++++++ .../image/generic/change-opacity/service.ts | 7 ++++ 2 files changed, 45 insertions(+) diff --git a/src/pages/tools/image/generic/change-opacity/index.tsx b/src/pages/tools/image/generic/change-opacity/index.tsx index 5aaa9950..44dcb8c1 100644 --- a/src/pages/tools/image/generic/change-opacity/index.tsx +++ b/src/pages/tools/image/generic/change-opacity/index.tsx @@ -4,6 +4,7 @@ import ToolFileResult from '@components/result/ToolFileResult'; import { changeOpacity } from './service'; import ToolContent from '@components/ToolContent'; import TextFieldWithDesc from '@components/options/TextFieldWithDesc'; +import ColorSelector from '@components/options/ColorSelector'; import { CardExampleType } from '@components/examples/ToolExamples'; import { ToolComponentProps } from '@tools/defineTool'; import { updateNumberField } from '@utils/string'; @@ -15,6 +16,8 @@ type InitialValuesType = { mode: 'solid' | 'gradient'; gradientType: 'linear' | 'radial'; gradientDirection: 'left-to-right' | 'inside-out'; + backgroundMode: 'transparent' | 'color'; + backgroundColor: string; areaLeft: number; areaTop: number; areaWidth: number; @@ -26,6 +29,8 @@ const initialValues: InitialValuesType = { mode: 'solid', gradientType: 'linear', gradientDirection: 'left-to-right', + backgroundMode: 'transparent', + backgroundColor: '#ffffff', areaLeft: 0, areaTop: 0, areaWidth: 100, @@ -41,6 +46,8 @@ const exampleCards: CardExampleType[] = [ mode: 'solid', gradientType: 'linear', gradientDirection: 'left-to-right', + backgroundMode: 'transparent', + backgroundColor: '#ffffff', areaLeft: 0, areaTop: 0, areaWidth: 100, @@ -56,6 +63,8 @@ const exampleCards: CardExampleType[] = [ mode: 'solid', gradientType: 'linear', gradientDirection: 'left-to-right', + backgroundMode: 'transparent', + backgroundColor: '#ffffff', areaLeft: 0, areaTop: 0, areaWidth: 100, @@ -71,6 +80,8 @@ const exampleCards: CardExampleType[] = [ mode: 'gradient', gradientType: 'radial', gradientDirection: 'inside-out', + backgroundMode: 'transparent', + backgroundColor: '#ffffff', areaLeft: 25, areaTop: 25, areaWidth: 50, @@ -135,6 +146,33 @@ export default function ChangeOpacity({ title }: ToolComponentProps) { ) }, + { + title: 'Background Options', + component: ( + + updateField('backgroundMode', 'transparent')} + checked={values.backgroundMode === 'transparent'} + description={'Preserve image transparency (default)'} + title={'Transparent (Alpha)'} + /> + updateField('backgroundMode', 'color')} + checked={values.backgroundMode === 'color'} + description={'Composite image over a solid background color'} + title={'Solid Color'} + /> + {values.backgroundMode === 'color' && ( + updateField('backgroundColor', val)} + description={'Choose background color'} + inputProps={{ 'data-testid': 'background-color-input' }} + /> + )} + + ) + }, { title: 'Gradient Options', component: ( diff --git a/src/pages/tools/image/generic/change-opacity/service.ts b/src/pages/tools/image/generic/change-opacity/service.ts index efcecaf3..3f4b703e 100644 --- a/src/pages/tools/image/generic/change-opacity/service.ts +++ b/src/pages/tools/image/generic/change-opacity/service.ts @@ -3,6 +3,8 @@ interface OpacityOptions { mode: 'solid' | 'gradient'; gradientType: 'linear' | 'radial'; gradientDirection: 'left-to-right' | 'inside-out'; + backgroundMode?: 'transparent' | 'color'; + backgroundColor?: string; areaLeft: number; areaTop: number; areaWidth: number; @@ -56,8 +58,13 @@ function applySolidOpacity( options: OpacityOptions ) { ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + if (options.backgroundMode === 'color' && options.backgroundColor) { + ctx.fillStyle = options.backgroundColor; + ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height); + } ctx.globalAlpha = options.opacity; ctx.drawImage(img, 0, 0); + ctx.globalAlpha = 1.0; } function applyGradientOpacity( From e90baa6b17f326131bcd4c48e730e5b56b4be68f Mon Sep 17 00:00:00 2001 From: Sushanth012 Date: Fri, 28 Aug 2026 22:14:19 -0700 Subject: [PATCH 11/33] fix: return the requested number of string chunks --- src/pages/tools/string/split/service.ts | 18 ++++++++---------- .../string/split/string-split.service.test.ts | 5 +++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/pages/tools/string/split/service.ts b/src/pages/tools/string/split/service.ts index cea1bdc6..dfea6fd5 100644 --- a/src/pages/tools/string/split/service.ts +++ b/src/pages/tools/string/split/service.ts @@ -18,17 +18,15 @@ function splitIntoChunks(text: string, numChunks: number) { 'Text length must be at least as long as the number of chunks' ); - const chunkSize = Math.ceil(totalLength / numChunks); // Calculate the chunk size, rounding up to handle remainders - let result = []; + const chunkSize = Math.floor(totalLength / numChunks); + const remainder = totalLength % numChunks; + const result: string[] = []; + let offset = 0; - for (let i = 0; i < totalLength; i += chunkSize) { - result.push(text.slice(i, i + chunkSize)); - } - - // Ensure the result contains exactly numChunks, adjusting the last chunk if necessary - if (result.length > numChunks) { - result[numChunks - 1] = result.slice(numChunks - 1).join(''); // Merge any extra chunks into the last chunk - result = result.slice(0, numChunks); // Take only the first numChunks chunks + for (let i = 0; i < numChunks; i++) { + const currentSize = chunkSize + (i < remainder ? 1 : 0); + result.push(text.slice(offset, offset + currentSize)); + offset += currentSize; } return result; diff --git a/src/pages/tools/string/split/string-split.service.test.ts b/src/pages/tools/string/split/string-split.service.test.ts index b1fe2976..21ba98d6 100644 --- a/src/pages/tools/string/split/string-split.service.test.ts +++ b/src/pages/tools/string/split/string-split.service.test.ts @@ -42,6 +42,11 @@ describe('compute function', () => { expect(result).toBe('[hello],[world],[again]'); }); + it('should return the requested number of uneven chunks', () => { + const result = compute('chunks', 'abcdef', '', '', 0, 4, '[', ']', ','); + expect(result).toBe('[ab],[cd],[e],[f]'); + }); + it('should handle empty input', () => { const result = compute('symbol', '', ' ', '', 0, 0, '', '', ','); expect(result).toBe(''); From 98c6d237b10c8ad0798fa88d0b1172e14071ad57 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Tue, 22 Sep 2026 20:40:19 +0200 Subject: [PATCH 12/33] chore: updated locales to add attributes option --- public/locales/en/xml.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/locales/en/xml.json b/public/locales/en/xml.json index 8acd4fcd..18b2e0a3 100644 --- a/public/locales/en/xml.json +++ b/public/locales/en/xml.json @@ -6,6 +6,11 @@ "resultTitle": "Beautified XML", "shortDescription": "Format and beautify XML code", "title": "XML Beautifier", + "options": { + "title": "Options", + "preserveAttributesTitle": "Preserve Attributes", + "preserveAttributesDesc": "Preserve the original XML attribute formatting and order." + }, "toolInfo": { "description": "This tool allows you to format XML data with proper indentation and spacing, making it more readable and easier to work with.", "title": "XML Beautifier" From 2d7fed69556b7a47d451671177a1771156662a2a Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Tue, 22 Sep 2026 20:41:47 +0200 Subject: [PATCH 13/33] chore: updated service for handling attributes option as param --- src/pages/tools/xml/xml-beautifier/service.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pages/tools/xml/xml-beautifier/service.ts b/src/pages/tools/xml/xml-beautifier/service.ts index 4fa512ad..86259a55 100644 --- a/src/pages/tools/xml/xml-beautifier/service.ts +++ b/src/pages/tools/xml/xml-beautifier/service.ts @@ -1,10 +1,7 @@ import { InitialValuesType } from './types'; import { XMLParser, XMLBuilder, XMLValidator } from 'fast-xml-parser'; -export function beautifyXml( - input: string, - _options: InitialValuesType -): string { +export function beautifyXml(input: string, options: InitialValuesType): string { const valid = XMLValidator.validate(input); if (valid !== true) { if (typeof valid === 'object' && valid.err) { @@ -12,13 +9,15 @@ export function beautifyXml( } return 'Invalid XML'; } + + const { preserveAttributes } = options; try { - const parser = new XMLParser({ ignoreAttributes: false }); + const parser = new XMLParser({ ignoreAttributes: !preserveAttributes }); const obj = parser.parse(input); const builder = new XMLBuilder({ format: true, indentBy: ' ', - ignoreAttributes: false + ignoreAttributes: !preserveAttributes }); return builder.build(obj); } catch (e: any) { From 7bf97e3951ffb04c4d2d6209f5cadf835aab679f Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Tue, 22 Sep 2026 20:42:54 +0200 Subject: [PATCH 14/33] chore: preserveAttributes added to types --- src/pages/tools/xml/xml-beautifier/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/tools/xml/xml-beautifier/types.ts b/src/pages/tools/xml/xml-beautifier/types.ts index d4135c9c..1ee79584 100644 --- a/src/pages/tools/xml/xml-beautifier/types.ts +++ b/src/pages/tools/xml/xml-beautifier/types.ts @@ -1,3 +1,3 @@ export type InitialValuesType = { - // splitSeparator: string; + preserveAttributes: boolean; }; From 4793cc628a0661b8f46e7253723664a848b4ef98 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Tue, 22 Sep 2026 20:43:29 +0200 Subject: [PATCH 15/33] chore: updated tests according service function signature --- .../tools/xml/xml-beautifier/xml-beautifier.service.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/tools/xml/xml-beautifier/xml-beautifier.service.test.ts b/src/pages/tools/xml/xml-beautifier/xml-beautifier.service.test.ts index 349744f9..70d93eab 100644 --- a/src/pages/tools/xml/xml-beautifier/xml-beautifier.service.test.ts +++ b/src/pages/tools/xml/xml-beautifier/xml-beautifier.service.test.ts @@ -4,7 +4,7 @@ import { beautifyXml } from './service'; describe('xml-beautifier', () => { it('beautifies valid XML', () => { const input = '12'; - const result = beautifyXml(input, {}); + const result = beautifyXml(input, { preserveAttributes: true }); expect(result).toContain(''); expect(result).toContain(' 1'); expect(result).toContain(' 2'); @@ -12,14 +12,14 @@ describe('xml-beautifier', () => { it('preserves attributes while beautifying XML', () => { const input = 'Alice'; - const result = beautifyXml(input, {}); + const result = beautifyXml(input, { preserveAttributes: true }); expect(result).toContain('Alice'); }); it('returns error for invalid XML', () => { const input = '1'; - const result = beautifyXml(input, {}); + const result = beautifyXml(input, { preserveAttributes: true }); expect(result).toMatch(/Invalid XML/i); }); }); From be42a5860c77b34fb3940966e2d0ad0388bef745 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Tue, 22 Sep 2026 20:44:21 +0200 Subject: [PATCH 16/33] chore: checkbox added to index for param handling --- src/pages/tools/xml/xml-beautifier/index.tsx | 41 ++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/src/pages/tools/xml/xml-beautifier/index.tsx b/src/pages/tools/xml/xml-beautifier/index.tsx index c1adb57f..8a57fa00 100644 --- a/src/pages/tools/xml/xml-beautifier/index.tsx +++ b/src/pages/tools/xml/xml-beautifier/index.tsx @@ -4,11 +4,15 @@ import { ToolComponentProps } from '@tools/defineTool'; import ToolTextInput from '@components/input/ToolTextInput'; import ToolTextResult from '@components/result/ToolTextResult'; import { CardExampleType } from '@components/examples/ToolExamples'; +import { GetGroupsType } from '@components/options/ToolOptions'; +import CheckboxWithDesc from '@components/options/CheckboxWithDesc'; import { beautifyXml } from './service'; import { InitialValuesType } from './types'; import { useTranslation } from 'react-i18next'; -const initialValues: InitialValuesType = {}; +const initialValues: InitialValuesType = { + preserveAttributes: true +}; const exampleCards: CardExampleType[] = [ { @@ -16,22 +20,37 @@ const exampleCards: CardExampleType[] = [ description: 'Beautify a compact XML string for readability.', sampleText: '12', sampleResult: `\n 1\n 2\n`, - sampleOptions: {} + sampleOptions: { preserveAttributes: true } } ]; -export default function XmlBeautifier({ - title, - longDescription -}: ToolComponentProps) { +export default function XmlBeautifier({ title }: ToolComponentProps) { const { t } = useTranslation('xml'); const [input, setInput] = useState(''); const [result, setResult] = useState(''); - const compute = (_values: InitialValuesType, input: string) => { - setResult(beautifyXml(input, {})); + const compute = (values: InitialValuesType, input: string) => { + if (!input || input.trim() == '') return; + setResult(beautifyXml(input, values)); }; + const getGroups: GetGroupsType | null = ({ + values, + updateField + }) => [ + { + title: t('xmlBeautifier.options.title'), + component: ( + updateField('preserveAttributes', value)} + title={t('xmlBeautifier.options.preserveAttributesTitle')} + description={t('xmlBeautifier.options.preserveAttributesDesc')} + /> + ) + } + ]; + return ( ); From 59ea2191b80ba1aa5c3ab557e12d3bc878b970a9 Mon Sep 17 00:00:00 2001 From: Chesterkxng <98062548+Chesterkxng@users.noreply.github.com> Date: Tue, 22 Sep 2026 19:06:34 +0000 Subject: [PATCH 17/33] chore: update i18n coverage table --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1c04fa9c..4f7a69db 100644 --- a/README.md +++ b/README.md @@ -154,16 +154,16 @@ The translation files are [here](public/locales). Only edit these if you are a d | Language | Translation status | Missing keys | |----------|--------------------|--------------| -| uk - Ukrainian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%` | 0 | -| zh - Chinese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░ 72%` | 478 | -| hi - Hindi | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 71%` | 505 | -| ru - Russian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 71%` | 493 | -| de - German | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 515 | -| es - Spanish | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 515 | -| fr - French | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 515 | -| ja - Japanese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 515 | -| nl - Dutch | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 515 | -| pt - Portuguese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 515 | +| uk - Ukrainian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%` | 3 | +| zh - Chinese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░ 72%` | 481 | +| ru - Russian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 71%` | 496 | +| de - German | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | +| es - Spanish | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | +| fr - French | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | +| hi - Hindi | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 508 | +| ja - Japanese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | +| nl - Dutch | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | +| pt - Portuguese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | ## ⭐ Star History From b3f0803cc4878d72a9fe5e30d5a3b6f2f7c5d4f7 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Tue, 22 Sep 2026 21:33:52 +0200 Subject: [PATCH 18/33] chore: removed comments --- src/pages/tools/number/sum/service.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/tools/number/sum/service.ts b/src/pages/tools/number/sum/service.ts index 992af840..41515e6b 100644 --- a/src/pages/tools/number/sum/service.ts +++ b/src/pages/tools/number/sum/service.ts @@ -16,8 +16,6 @@ export const compute = ( if (extractionType === 'smart') { numbers = getAllNumbers(input); } else { - // The UI advertises a literal "\n" option as a line break; normalize it to an actual newline - // so multiline inputs split correctly instead of being treated as a single part. const normalizedSeparator = separator.replace(/\\n/g, '\n'); const parts = input.split(normalizedSeparator); // Filter out and convert parts that are numbers From 0d44e5b152e04e8606a1d3975bed0209dc93de91 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Wed, 23 Sep 2026 22:09:06 +0200 Subject: [PATCH 19/33] chore: updated service --- src/pages/tools/number/sum/index.tsx | 2 +- src/pages/tools/number/sum/service.ts | 58 ++++++++++++++++----------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/pages/tools/number/sum/index.tsx b/src/pages/tools/number/sum/index.tsx index d649f995..08f0d1c2 100644 --- a/src/pages/tools/number/sum/index.tsx +++ b/src/pages/tools/number/sum/index.tsx @@ -130,7 +130,7 @@ export default function SumNumbers({ title }: ToolComponentProps) { { title: t('sum.numberExtraction'), component: extractionTypes.map( - ({ title, description, type, withTextField, textValueAccessor }) => + ({ title, type, withTextField, textValueAccessor }) => withTextField ? ( part.trim()) + .filter((part) => part !== '' && !Number.isNaN(Number(part))) + .map(Number); +} export const compute = ( input: string, @@ -12,27 +25,24 @@ export const compute = ( printRunningSum: boolean, separator: string ): string => { - let numbers: number[] = []; - if (extractionType === 'smart') { - numbers = getAllNumbers(input); - } else { - const normalizedSeparator = separator.replace(/\\n/g, '\n'); - const parts = input.split(normalizedSeparator); - // Filter out and convert parts that are numbers - numbers = parts - .filter((part) => !isNaN(Number(part)) && part.trim() !== '') - .map(Number); - } + console.log( + 'COMPUTE CALLED WITH:', + JSON.stringify(input), + 'separator:', + JSON.stringify(separator) + ); + + const numbers = + extractionType === 'smart' + ? getAllNumbers(input) + : getDelimitedNumbers(input, separator); + if (printRunningSum) { - let result: string = ''; - let sum: number = 0; - for (const i of numbers) { - sum = sum + i; - result = result + sum + '\n'; - } - return result; - } else - return numbers - .reduce((previousValue, currentValue) => previousValue + currentValue, 0) - .toString(); + let sum = 0; + return ( + numbers.map((n) => (sum += n)).join('\n') + (numbers.length ? '\n' : '') + ); + } + + return numbers.reduce((acc, n) => acc + n, 0).toString(); }; From 20f8b4aebc646bbc38668e3e135d73ec1c089906 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Wed, 23 Sep 2026 22:20:47 +0200 Subject: [PATCH 20/33] chore: debbugging lines removed --- src/pages/tools/number/sum/service.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/pages/tools/number/sum/service.ts b/src/pages/tools/number/sum/service.ts index 1cbd029c..615fc79b 100644 --- a/src/pages/tools/number/sum/service.ts +++ b/src/pages/tools/number/sum/service.ts @@ -25,13 +25,6 @@ export const compute = ( printRunningSum: boolean, separator: string ): string => { - console.log( - 'COMPUTE CALLED WITH:', - JSON.stringify(input), - 'separator:', - JSON.stringify(separator) - ); - const numbers = extractionType === 'smart' ? getAllNumbers(input) From 5dd5f49d69f6209e19ff2d87aa5d906ef9fdf4fd Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Fri, 25 Sep 2026 11:48:43 +0200 Subject: [PATCH 21/33] chore: rgba parser from hex added to color util --- src/utils/color.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/utils/color.ts b/src/utils/color.ts index 37e73dd8..1db42981 100644 --- a/src/utils/color.ts +++ b/src/utils/color.ts @@ -29,3 +29,27 @@ export function convertHexToRGBA(color: string): number { const alphaChannel = 0xff; return (colorValue << 8) | alphaChannel; } + +/** + * Parses any valid CSS color string into its RGB components, + * using the canvas's own color parser for correctness across + * hex (#fff, #ffffff), rgb()/rgba(), hsl(), and named colors. + */ +export function parseColorToRgb(color: string): { + r: number; + g: number; + b: number; +} { + const canvas = document.createElement('canvas'); + canvas.width = canvas.height = 1; + const ctx = canvas.getContext('2d'); + if (!ctx) { + throw new Error('Canvas context not supported'); + } + + ctx.fillStyle = color; // browser validates & normalizes the color here + ctx.fillRect(0, 0, 1, 1); + + const [r, g, b] = ctx.getImageData(0, 0, 1, 1).data; + return { r, g, b }; +} From afac8f73ec0b50a2462fbef07559e252d3cf66f2 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Fri, 25 Sep 2026 11:50:10 +0200 Subject: [PATCH 22/33] chore : image util file created - getImageDimensions - getMaxAreaPosition --- src/utils/image.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/utils/image.ts diff --git a/src/utils/image.ts b/src/utils/image.ts new file mode 100644 index 00000000..29c509dd --- /dev/null +++ b/src/utils/image.ts @@ -0,0 +1,43 @@ +/** + * Gets the dimensions of an image file. + * + * @param file - The image file to get the dimensions from. + * @returns A promise resolving to the image width and height in pixels. + */ +export function getImageDimensions( + file: File +): Promise<{ width: number; height: number }> { + return new Promise((resolve, reject) => { + const url = URL.createObjectURL(file); + const img = new Image(); + + img.onload = () => { + URL.revokeObjectURL(url); + resolve({ + width: img.width, + height: img.height + }); + }; + + img.onerror = () => { + URL.revokeObjectURL(url); + reject(new Error('Failed to load image')); + }; + + img.src = url; + }); +} + +/** + * Returns the maximum position for an area so it stays within the image bounds. + * + * @param imageSize - The image width or height. + * @param areaSize - The width or height of the area. + * @returns The maximum allowed position. + */ +export function getMaxAreaPosition( + imageSize: number, + areaSize: number +): number { + return Math.max(0, imageSize - areaSize); +} From 45366d25f6393a2675db9867ddbd98ab6251aef6 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Fri, 25 Sep 2026 11:51:08 +0200 Subject: [PATCH 23/33] chore: i18n keys for complete translation --- public/locales/en/image.json | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/public/locales/en/image.json b/public/locales/en/image.json index c887a62e..3a2ba244 100644 --- a/public/locales/en/image.json +++ b/public/locales/en/image.json @@ -22,7 +22,34 @@ "changeOpacity": { "description": "Easily adjust the transparency of your images. Simply upload your image, use the slider to set the desired opacity level between 0 (fully transparent) and 1 (fully opaque), and download the modified image.", "shortDescription": "Adjust transparency of images", - "title": "Change image Opacity" + "title": "Change image Opacity", + "inputTitle": "Input image", + "resultTitle": "Processed Image", + "options": { + "opacitySettings": "Opacity Settings", + "opacityDescription": "Set opacity between 0 (transparent) and 1 (opaque)", + "solidOpacityTitle": "Apply Solid Opacity", + "solidOpacityDescription": "Set the same opacity level for all pixels", + "gradientOpacityTitle": "Apply Gradient Opacity", + "gradientOpacityDescription": "Change opacity in a gradient", + "gradientType": "Gradient Type", + "linearOpacity": "Linear opacity", + "radialOpacity": "Radial opacity", + "opacityArea": "Opacity Area", + "leftPosition": "Left position", + "topPosition": "Top position", + "width": "Width", + "height": "Height", + "backgroundOptions": "Background Options", + "transparentAlpha": "Transparent (Alpha)", + "transparentAlphaDescription": "Preserve image transparency (default)", + "solidColor": "Solid Color", + "solidColorDescription": "Composite image over a solid background color", + "chooseBackgroundColor": "Choose background color", + "insideOut": "Inside -> Outside", + "outsideIn": "Outside -> Inside", + "gradientDirection": "Gradient Direction" + } }, "compress": { "compressedSize": "Total compressed size", From 91eaf02b01e204a92426c6b31fda98e94938cc8f Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Fri, 25 Sep 2026 11:51:40 +0200 Subject: [PATCH 24/33] chore: types.ts file --- .../tools/image/generic/change-opacity/types.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/pages/tools/image/generic/change-opacity/types.ts diff --git a/src/pages/tools/image/generic/change-opacity/types.ts b/src/pages/tools/image/generic/change-opacity/types.ts new file mode 100644 index 00000000..1aa1412e --- /dev/null +++ b/src/pages/tools/image/generic/change-opacity/types.ts @@ -0,0 +1,12 @@ +export type InitialValuesType = { + opacity: number; + mode: 'solid' | 'gradient'; + gradientType: 'linear' | 'radial'; + gradientDirection: 'left-to-right' | 'inside-out' | 'outside-in'; + backgroundMode: 'transparent' | 'color'; + backgroundColor: string; + areaLeft: number; + areaTop: number; + areaWidth: number; + areaHeight: number; +}; From 7e46a76842da338691c7b5b9f6153f52745bf3b2 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Fri, 25 Sep 2026 11:53:28 +0200 Subject: [PATCH 25/33] chore: service updated - types import - default white background changed to user selected color --- .../image/generic/change-opacity/service.ts | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/pages/tools/image/generic/change-opacity/service.ts b/src/pages/tools/image/generic/change-opacity/service.ts index 3f4b703e..4a31c239 100644 --- a/src/pages/tools/image/generic/change-opacity/service.ts +++ b/src/pages/tools/image/generic/change-opacity/service.ts @@ -1,19 +1,9 @@ -interface OpacityOptions { - opacity: number; - mode: 'solid' | 'gradient'; - gradientType: 'linear' | 'radial'; - gradientDirection: 'left-to-right' | 'inside-out'; - backgroundMode?: 'transparent' | 'color'; - backgroundColor?: string; - areaLeft: number; - areaTop: number; - areaWidth: number; - areaHeight: number; -} +import { InitialValuesType } from './types'; +import { parseColorToRgb } from '@utils/color'; export async function changeOpacity( file: File, - options: OpacityOptions + options: InitialValuesType ): Promise { return new Promise((resolve, reject) => { const reader = new FileReader(); @@ -52,10 +42,18 @@ export async function changeOpacity( }); } +function getGradientRgbTriplet(options: InitialValuesType): string { + if (options.backgroundMode === 'color' && options.backgroundColor) { + const { r, g, b } = parseColorToRgb(options.backgroundColor); + return `${r},${g},${b}`; + } + return '255,255,255'; // fallback: white +} + function applySolidOpacity( ctx: CanvasRenderingContext2D, img: HTMLImageElement, - options: OpacityOptions + options: InitialValuesType ) { ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); if (options.backgroundMode === 'color' && options.backgroundColor) { @@ -70,7 +68,7 @@ function applySolidOpacity( function applyGradientOpacity( ctx: CanvasRenderingContext2D, img: HTMLImageElement, - options: OpacityOptions + options: InitialValuesType ) { const { areaLeft, areaTop, areaWidth, areaHeight } = options; @@ -88,28 +86,30 @@ function applyGradientOpacity( function createLinearGradient( ctx: CanvasRenderingContext2D, - options: OpacityOptions + options: InitialValuesType ) { - const { areaLeft, areaTop, areaWidth, areaHeight } = options; + const { areaLeft, areaTop, areaWidth } = options; + const rgb = getGradientRgbTriplet(options); const gradient = ctx.createLinearGradient( areaLeft, areaTop, areaLeft + areaWidth, areaTop ); - gradient.addColorStop(0, `rgba(255,255,255,${options.opacity})`); - gradient.addColorStop(1, 'rgba(255,255,255,0)'); + gradient.addColorStop(0, `rgba(${rgb},${options.opacity})`); + gradient.addColorStop(1, `rgba(${rgb},0)`); return gradient; } function createRadialGradient( ctx: CanvasRenderingContext2D, - options: OpacityOptions + options: InitialValuesType ) { const { areaLeft, areaTop, areaWidth, areaHeight } = options; const centerX = areaLeft + areaWidth / 2; const centerY = areaTop + areaHeight / 2; const radius = Math.min(areaWidth, areaHeight) / 2; + const rgb = getGradientRgbTriplet(options); const gradient = ctx.createRadialGradient( centerX, @@ -121,11 +121,11 @@ function createRadialGradient( ); if (options.gradientDirection === 'inside-out') { - gradient.addColorStop(0, `rgba(255,255,255,${options.opacity})`); - gradient.addColorStop(1, 'rgba(255,255,255,0)'); + gradient.addColorStop(0, `rgba(${rgb},${options.opacity})`); + gradient.addColorStop(1, `rgba(${rgb},0)`); } else { - gradient.addColorStop(0, 'rgba(255,255,255,0)'); - gradient.addColorStop(1, `rgba(255,255,255,${options.opacity})`); + gradient.addColorStop(0, `rgba(${rgb},0)`); + gradient.addColorStop(1, `rgba(${rgb},${options.opacity})`); } return gradient; From b43606985bea1a3d4ae0154b7ebe65b8ab77b35a Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Fri, 25 Sep 2026 11:54:50 +0200 Subject: [PATCH 26/33] chore: - full i18n support - options grouped and displayed correctly --- .../image/generic/change-opacity/index.tsx | 416 ++++++++++-------- 1 file changed, 222 insertions(+), 194 deletions(-) diff --git a/src/pages/tools/image/generic/change-opacity/index.tsx b/src/pages/tools/image/generic/change-opacity/index.tsx index 44dcb8c1..beb6c844 100644 --- a/src/pages/tools/image/generic/change-opacity/index.tsx +++ b/src/pages/tools/image/generic/change-opacity/index.tsx @@ -1,107 +1,250 @@ -import React, { useState } from 'react'; +import React, { useState, useMemo, useEffect } from 'react'; import ToolImageInput from '@components/input/ToolImageInput'; import ToolFileResult from '@components/result/ToolFileResult'; import { changeOpacity } from './service'; import ToolContent from '@components/ToolContent'; import TextFieldWithDesc from '@components/options/TextFieldWithDesc'; +import SelectWithDesc from '@components/options/SelectWithDesc'; import ColorSelector from '@components/options/ColorSelector'; -import { CardExampleType } from '@components/examples/ToolExamples'; import { ToolComponentProps } from '@tools/defineTool'; +import { GetGroupsType } from '@components/options/ToolOptions'; import { updateNumberField } from '@utils/string'; import { Box } from '@mui/material'; import SimpleRadio from '@components/options/SimpleRadio'; +import { InitialValuesType } from './types'; +import { debounce } from 'lodash'; +import { useTranslation } from 'react-i18next'; +import { getImageDimensions, getMaxAreaPosition } from '@utils/image'; -type InitialValuesType = { - opacity: number; - mode: 'solid' | 'gradient'; - gradientType: 'linear' | 'radial'; - gradientDirection: 'left-to-right' | 'inside-out'; - backgroundMode: 'transparent' | 'color'; - backgroundColor: string; - areaLeft: number; - areaTop: number; - areaWidth: number; - areaHeight: number; -}; - -const initialValues: InitialValuesType = { +const getInitialValues = ( + width: number, + height: number +): InitialValuesType => ({ opacity: 0.5, mode: 'solid', gradientType: 'linear', - gradientDirection: 'left-to-right', + gradientDirection: 'inside-out', backgroundMode: 'transparent', backgroundColor: '#ffffff', areaLeft: 0, areaTop: 0, - areaWidth: 100, - areaHeight: 100 -}; - -const exampleCards: CardExampleType[] = [ - { - title: 'Semi-transparent PNG', - description: 'Make an image 50% transparent', - sampleOptions: { - opacity: 0.5, - mode: 'solid', - gradientType: 'linear', - gradientDirection: 'left-to-right', - backgroundMode: 'transparent', - backgroundColor: '#ffffff', - areaLeft: 0, - areaTop: 0, - areaWidth: 100, - areaHeight: 100 - }, - sampleResult: '' - }, - { - title: 'Slightly Faded PNG', - description: 'Create a subtle transparency effect', - sampleOptions: { - opacity: 0.8, - mode: 'solid', - gradientType: 'linear', - gradientDirection: 'left-to-right', - backgroundMode: 'transparent', - backgroundColor: '#ffffff', - areaLeft: 0, - areaTop: 0, - areaWidth: 100, - areaHeight: 100 - }, - sampleResult: '' - }, - { - title: 'Radial Gradient Opacity', - description: 'Apply a radial gradient opacity effect', - sampleOptions: { - opacity: 0.8, - mode: 'gradient', - gradientType: 'radial', - gradientDirection: 'inside-out', - backgroundMode: 'transparent', - backgroundColor: '#ffffff', - areaLeft: 25, - areaTop: 25, - areaWidth: 50, - areaHeight: 50 - }, - sampleResult: '' - } -]; - + areaWidth: width, + areaHeight: height +}); export default function ChangeOpacity({ title }: ToolComponentProps) { + const { t } = useTranslation('image'); const [input, setInput] = useState(null); const [result, setResult] = useState(null); + const [imageSize, setImageSize] = useState({ + width: 0, + height: 0 + }); + + useEffect(() => { + if (!input) { + setImageSize({ width: 0, height: 0 }); + return; + } + + getImageDimensions(input).then(setImageSize); + }, [input]); + + const initialValues = useMemo( + () => getInitialValues(imageSize.width, imageSize.height), + [imageSize.width, imageSize.height] + ); + const compute = (values: InitialValuesType, input: any) => { if (input) { changeOpacity(input, values).then(setResult); } }; + + const debouncedCompute = useMemo(() => debounce(compute, 1000), []); + + useEffect(() => { + return () => { + debouncedCompute.cancel(); + }; + }, [debouncedCompute]); + + const getGroups: GetGroupsType | null = ({ + values, + updateField + }) => [ + { + title: t('changeOpacity.options.opacitySettings'), + component: ( + + + updateNumberField(val, 'opacity', updateField) + } + type="number" + inputProps={{ step: 0.1, min: 0, max: 1 }} + /> + updateField('mode', 'solid')} + checked={values.mode === 'solid'} + description={t('changeOpacity.options.solidOpacityDescription')} + title={t('changeOpacity.options.solidOpacityTitle')} + /> + updateField('mode', 'gradient')} + checked={values.mode === 'gradient'} + description={t('changeOpacity.options.gradientOpacityDescription')} + title={t('changeOpacity.options.gradientOpacityTitle')} + /> + + {values.mode === 'gradient' && ( + + { + updateField('gradientType', value); + + if (value === 'linear') { + updateField('gradientDirection', 'left-to-right'); + } else { + updateField('gradientDirection', 'inside-out'); + } + }} + description={t('changeOpacity.options.gradientType')} + /> + + )} + + {values.gradientType === 'radial' && ( + + updateField('gradientDirection', value)} + description={t('changeOpacity.options.gradientDirection')} + /> + + )} + + ) + }, + ...(values.mode === 'gradient' + ? [ + { + title: t('changeOpacity.options.opacityArea'), + component: ( + + + updateNumberField(val, 'areaLeft', updateField) + } + inputProps={{ + min: 0, + max: getMaxAreaPosition(imageSize.width, values.areaWidth) + }} + type="number" + /> + + + updateNumberField(val, 'areaTop', updateField) + } + inputProps={{ + min: 0, + max: getMaxAreaPosition(imageSize.height, values.areaHeight) + }} + type="number" + /> + + + updateNumberField(val, 'areaWidth', updateField) + } + inputProps={{ + min: 1, + max: imageSize.width || undefined + }} + type="number" + /> + + + updateNumberField(val, 'areaHeight', updateField) + } + inputProps={{ + min: 1, + max: imageSize.height || undefined + }} + type="number" + /> + + ) + } + ] + : []), + { + title: t('changeOpacity.options.backgroundOptions'), + component: ( + + updateField('backgroundMode', 'transparent')} + checked={values.backgroundMode === 'transparent'} + description={t('changeOpacity.options.transparentAlphaDescription')} + title={t('changeOpacity.options.transparentAlpha')} + /> + updateField('backgroundMode', 'color')} + checked={values.backgroundMode === 'color'} + description={t('changeOpacity.options.solidColorDescription')} + title={t('changeOpacity.options.solidColor')} + /> + {values.backgroundMode === 'color' && ( + + updateField('backgroundColor', val)} + description={t('changeOpacity.options.chooseBackgroundColor')} + inputProps={{ 'data-testid': 'background-color-input' }} + /> + + )} + + ) + } + ]; + return ( } resultComponent={ - + } initialValues={initialValues} - // exampleCards={exampleCards} - getGroups={({ values, updateField }) => [ - { - title: 'Opacity Settings', - component: ( - - - updateNumberField(val, 'opacity', updateField) - } - type="number" - inputProps={{ step: 0.1, min: 0, max: 1 }} - /> - updateField('mode', 'solid')} - checked={values.mode === 'solid'} - description={'Set the same opacity level for all pixels'} - title={'Apply Solid Opacity'} - /> - updateField('mode', 'gradient')} - checked={values.mode === 'gradient'} - description={'Change opacity in a gradient'} - title={'Apply Gradient Opacity'} - /> - - ) - }, - { - title: 'Background Options', - component: ( - - updateField('backgroundMode', 'transparent')} - checked={values.backgroundMode === 'transparent'} - description={'Preserve image transparency (default)'} - title={'Transparent (Alpha)'} - /> - updateField('backgroundMode', 'color')} - checked={values.backgroundMode === 'color'} - description={'Composite image over a solid background color'} - title={'Solid Color'} - /> - {values.backgroundMode === 'color' && ( - updateField('backgroundColor', val)} - description={'Choose background color'} - inputProps={{ 'data-testid': 'background-color-input' }} - /> - )} - - ) - }, - { - title: 'Gradient Options', - component: ( - - updateField('gradientType', 'linear')} - checked={values.gradientType === 'linear'} - description={'Linear opacity direction'} - title={'Linear Gradient'} - /> - updateField('gradientType', 'radial')} - checked={values.gradientType === 'radial'} - description={'Radial opacity direction'} - title={'Radial Gradient'} - /> - - ) - }, - { - title: 'Opacity Area', - component: ( - - - updateNumberField(val, 'areaLeft', updateField) - } - type="number" - /> - - updateNumberField(val, 'areaTop', updateField) - } - type="number" - /> - - updateNumberField(val, 'areaWidth', updateField) - } - type="number" - /> - - updateNumberField(val, 'areaHeight', updateField) - } - type="number" - /> - - ) - } - ]} - compute={compute} + getGroups={getGroups} + compute={debouncedCompute} /> ); } From cccba669a484e76c6f41f6bc077b8f9e6c326763 Mon Sep 17 00:00:00 2001 From: Chesterkxng <98062548+Chesterkxng@users.noreply.github.com> Date: Fri, 25 Sep 2026 10:06:40 +0000 Subject: [PATCH 27/33] chore: update i18n coverage table --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4f7a69db..f21e6a94 100644 --- a/README.md +++ b/README.md @@ -154,16 +154,16 @@ The translation files are [here](public/locales). Only edit these if you are a d | Language | Translation status | Missing keys | |----------|--------------------|--------------| -| uk - Ukrainian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%` | 3 | -| zh - Chinese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░ 72%` | 481 | -| ru - Russian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 71%` | 496 | -| de - German | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | -| es - Spanish | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | -| fr - French | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | -| hi - Hindi | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 508 | -| ja - Japanese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | -| nl - Dutch | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | -| pt - Portuguese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 518 | +| uk - Ukrainian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░ 98%` | 28 | +| zh - Chinese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 71%` | 506 | +| ru - Russian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 521 | +| de - German | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | +| es - Spanish | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | +| fr - French | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | +| hi - Hindi | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 533 | +| ja - Japanese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | +| nl - Dutch | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | +| pt - Portuguese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | ## ⭐ Star History From 3e549f46005e5c9ef46c1ec1c7ae756003a15d73 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Wed, 30 Sep 2026 11:40:52 +0200 Subject: [PATCH 28/33] chore: restore image component --- .../input/ToolMultipleImageInput.tsx | 71 ++++++++----------- 1 file changed, 30 insertions(+), 41 deletions(-) diff --git a/src/components/input/ToolMultipleImageInput.tsx b/src/components/input/ToolMultipleImageInput.tsx index 080859e3..6804caad 100644 --- a/src/components/input/ToolMultipleImageInput.tsx +++ b/src/components/input/ToolMultipleImageInput.tsx @@ -37,7 +37,36 @@ export default function ToolMultiImageInput({ const files = event.target.files; if (!files) return; - await processFiles(Array.from(files)); + const newFiles: MultiImageInput[] = await Promise.all( + Array.from(files).map(async (file, index) => { + let processedFile = file; + + try { + if (await isHeic(file)) { + const convertedBlob = await heicTo({ + blob: file, + type: 'image/jpeg' + }); + + processedFile = new File( + [convertedBlob], + file.name.replace(/\.[^/.]+$/, '') + '.jpg', + { type: 'image/jpeg' } + ); + } + } catch (err) { + console.warn('HEIC conversion failed:', file.name, err); + } + + return { + file: processedFile, + order: value.length + index, + preview: URL.createObjectURL(processedFile) + }; + }) + ); + + onChange([...value, ...newFiles]); event.target.value = ''; }; @@ -70,44 +99,6 @@ export default function ToolMultiImageInput({ : fileName; } - const processFiles = async (files: File[]) => { - const newFiles: MultiImageInput[] = await Promise.all( - Array.from(files).map(async (file, index) => { - let processedFile = file; - - try { - if (await isHeic(file)) { - const convertedBlob = await heicTo({ - blob: file, - type: 'image/jpeg' - }); - processedFile = new File( - [convertedBlob], - file.name.replace(/\.[^/.]+$/, '') + '.jpg', - { type: 'image/jpeg' } - ); - } - } catch (err) { - console.warn('HEIC conversion failed:', file.name, err); - } - - return { - file: processedFile, - order: value.length + index, - preview: URL.createObjectURL(processedFile) - }; - }) - ); - - onChange([...value, ...newFiles]); - }; - - const handleDrop = (e: React.DragEvent) => { - e.preventDefault(); - const files = e.dataTransfer.files; - processFiles(Array.from(files)); - }; - return ( ) => e.preventDefault()} - onDrop={handleDrop} > Date: Wed, 30 Sep 2026 11:42:21 +0200 Subject: [PATCH 29/33] chore: updated types to handle timing mode --- src/pages/tools/video/gif/images-to-gif/types.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/tools/video/gif/images-to-gif/types.ts b/src/pages/tools/video/gif/images-to-gif/types.ts index 48cdaecd..a6e2e929 100644 --- a/src/pages/tools/video/gif/images-to-gif/types.ts +++ b/src/pages/tools/video/gif/images-to-gif/types.ts @@ -1,3 +1,4 @@ export interface InitialValuesType { - frameDelay: number; + frameRateMode: 'fps' | 'delay'; + frameRateValue: number; } From b5224b286e5b39e5d9b864660ab5e8978e6f9922 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Wed, 30 Sep 2026 11:44:21 +0200 Subject: [PATCH 30/33] chore: durationSeconds computed on rate mode --- src/pages/tools/video/gif/images-to-gif/service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/tools/video/gif/images-to-gif/service.ts b/src/pages/tools/video/gif/images-to-gif/service.ts index 6076428f..13e30c44 100644 --- a/src/pages/tools/video/gif/images-to-gif/service.ts +++ b/src/pages/tools/video/gif/images-to-gif/service.ts @@ -8,12 +8,14 @@ export async function imagesToGif( optionsValues: InitialValuesType ): Promise { return runFFmpegTask(async ({ ffmpeg, tempFile }) => { - const { frameDelay } = optionsValues; + const { frameRateMode, frameRateValue } = optionsValues; + const fileNames: string[] = []; const listName = tempFile('.txt'); const outputName = tempFile('.gif'); - const durationSeconds = frameDelay / 1000; + const durationSeconds = + frameRateMode === 'fps' ? 1 / frameRateValue : frameRateValue / 1000; for (let i = 0; i < input.length; i++) { const file = input[i]; From cc81640410f8430356a6235ec759365815415f08 Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Wed, 30 Sep 2026 11:46:06 +0200 Subject: [PATCH 31/33] chore: - radioboxes added to index file - full i18n support --- public/locales/en/video.json | 5 +- .../tools/video/gif/images-to-gif/index.tsx | 63 +++++++++++-------- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/public/locales/en/video.json b/public/locales/en/video.json index d5d8b7ae..ae701977 100644 --- a/public/locales/en/video.json +++ b/public/locales/en/video.json @@ -112,7 +112,10 @@ "loadingText": "Creating GIF...", "frameOptions": "Frame Options", "frameDelayDescription": "How long each frame is displayed, in milliseconds (e.g. 500 = 0.5 s per frame)", - "frameDelayMStoFPS": "Alternative way to set frame delay, in frames per second" + "frameRateDescription": "Set the animation speed in frames per second (FPS)", + "frameRateValueDescription": "Set the desired value", + "frameDelay": "Frame delay", + "frameRate": "Frames per second (FPS)" } }, "loop": { diff --git a/src/pages/tools/video/gif/images-to-gif/index.tsx b/src/pages/tools/video/gif/images-to-gif/index.tsx index e38676d4..d4c0ff13 100644 --- a/src/pages/tools/video/gif/images-to-gif/index.tsx +++ b/src/pages/tools/video/gif/images-to-gif/index.tsx @@ -7,6 +7,7 @@ import { ToolComponentProps } from '@tools/defineTool'; import ToolMultipleImageInput, { MultiImageInput } from '@components/input/ToolMultipleImageInput'; +import SimpleRadio from '@components/options/SimpleRadio'; import { InitialValuesType } from './types'; import { updateNumberField } from '@utils/string'; import { useTranslation } from 'react-i18next'; @@ -14,7 +15,8 @@ import { imagesToGif } from './service'; import { debounce } from 'lodash'; const initialValues: InitialValuesType = { - frameDelay: 500 + frameRateMode: 'fps', + frameRateValue: 10 }; export default function ImagesToGif({ title }: ToolComponentProps) { @@ -71,39 +73,48 @@ export default function ImagesToGif({ title }: ToolComponentProps) { { title: t('gif.imagesToGif.frameOptions'), component: ( - <> - + + updateField('frameRateMode', 'fps')} + /> + + updateField('frameRateMode', 'delay')} + /> + + { + const { min, max } = + values.frameRateMode === 'fps' + ? { min: 1, max: 60 } + : { min: 50, max: 10000 }; + const clamped = Math.min( - 10000, - Math.max(50, Number(value)) + max, + Math.max(min, Number(value)) ).toString(); - updateNumberField(clamped, 'frameDelay', updateField); + + updateNumberField(clamped, 'frameRateValue', updateField); }} - value={values.frameDelay} + value={values.frameRateValue} /> - - { - const fps = Math.min(60, Math.max(1, Number(value))); - const ms = 1000 / fps; - const msString = ms.toString(); - updateNumberField(msString, 'frameDelay', updateField); - }} - value={1000 / values.frameDelay} - /> - - + ) } ]} From 1d334f183df34179381f653e8c012126c965641d Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Wed, 30 Sep 2026 12:10:22 +0200 Subject: [PATCH 32/33] chore: small fix for gif quality --- src/pages/tools/video/gif/images-to-gif/service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/tools/video/gif/images-to-gif/service.ts b/src/pages/tools/video/gif/images-to-gif/service.ts index 13e30c44..e2098f14 100644 --- a/src/pages/tools/video/gif/images-to-gif/service.ts +++ b/src/pages/tools/video/gif/images-to-gif/service.ts @@ -43,7 +43,7 @@ export async function imagesToGif( '-i', listName, '-vf', - 'scale=480:-2:flags=lanczos', + 'scale=iw:-2:flags=lanczos', '-loop', '0', outputName From 4e5c53e3b982bc2de1cea0f1823b0fb0cd89d15a Mon Sep 17 00:00:00 2001 From: Chesterkxng <98062548+Chesterkxng@users.noreply.github.com> Date: Wed, 30 Sep 2026 10:25:09 +0000 Subject: [PATCH 33/33] chore: update i18n coverage table --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f21e6a94..fb051ea5 100644 --- a/README.md +++ b/README.md @@ -154,16 +154,16 @@ The translation files are [here](public/locales). Only edit these if you are a d | Language | Translation status | Missing keys | |----------|--------------------|--------------| -| uk - Ukrainian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░ 98%` | 28 | -| zh - Chinese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 71%` | 506 | -| ru - Russian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 521 | -| de - German | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | -| es - Spanish | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | -| fr - French | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | -| hi - Hindi | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 533 | -| ja - Japanese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | -| nl - Dutch | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | -| pt - Portuguese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 543 | +| uk - Ukrainian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░ 98%` | 32 | +| zh - Chinese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 71%` | 510 | +| ru - Russian | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 70%` | 525 | +| de - German | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 547 | +| es - Spanish | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 547 | +| fr - French | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 547 | +| hi - Hindi | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 537 | +| ja - Japanese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 547 | +| nl - Dutch | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 547 | +| pt - Portuguese | `▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 69%` | 547 | ## ⭐ Star History