Repository navigation
fix(ffmpeg): fix scale filter quote syntax for ico conversions - #728
Open
codeCraft-Ritik wants to merge 1 commit into
Open
codeCraft-Ritik wants to merge 1 commit into
codeCraft-Ritik wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a filter syntax error in
src/converters/ffmpeg.tswhere image-to-ICO conversions fail due to a misplaced single quote in the scale filter expression.Problem & Root Cause
When converting an image to
.ico, FFmpeg applies a video filter to scale down images that exceed 256×256 pixels:In the height expression:
:min'(256,ih)':had the opening single quote placed aftermininstead of before it ('min(256,ih)').:minas an unrecognized filter option key and(256,ih)as an invalid token, throwing an[AVFilterGraph] Error initializing filter 'scale'runtime error.Because
tests/converters/ffmpeg.test.tspreviously used a mockexecFilethat asserted against a string copy of the same typo, the unit tests passed without executing FFmpeg.Solution
src/converters/ffmpeg.ts:scale='min(256,iw)':'min(256,ih)':force_original_aspect_ratio=decreaseICO_FILTERexpectation intests/converters/ffmpeg.test.ts.Verification
tests/converters/ffmpeg.test.tspass cleanly.Summary by cubic
Fixes ICO conversions that fail when FFmpeg parses the scale filter by correcting the quote placement around the height expression.
Written for commit b1ab40c. Summary will update on new commits.