Skip to content

🎥 Make videos programmatically with React

handle when setting imageFormat to "jpg" instead of "jpeg"

Jonny Burger856c65e2daf7
diff --git a/packages/cli/src/config/image-format.ts b/packages/cli/src/config/image-format.ts
index d61c976284..9d4f40dff5 100644
--- a/packages/cli/src/config/image-format.ts
+++ b/packages/cli/src/config/image-format.ts
@@ -1,5 +1,6 @@
import type {ImageFormat} from '@remotion/renderer';
import {RenderInternals} from '@remotion/renderer';
+import {truthy} from '../truthy';
let currentImageFormat: ImageFormat | undefined;
@@ -10,7 +11,15 @@ export const setImageFormat = (format: ImageFormat) => {
}
if (!RenderInternals.validImageFormats.includes(format)) {
- throw new TypeError(`Value ${format} is not valid as an image format.`);
+ throw new TypeError(
+ [
+ `Value ${format} is not valid as an image format.`,
+ // @ts-expect-error
+ format === 'jpg' ? 'Did you mean "jpeg"?' : null,
+ ]
+ .filter(truthy)
+ .join(' ')
+ );
}
currentImageFormat = format;