Skip to content

Commit 3c71ca8

Browse files
chore: add console warning for data images
1 parent 9fb9f9e commit 3c71ca8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

utils/get-image-dimensions.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@ const probeImage = async url => {
3232

3333
const getImageDimensions = async (url, description) => {
3434
try {
35-
if (url.startsWith('data:'))
36-
throw new Error('Data URI images are not supported');
35+
if (url.startsWith('data:')) {
36+
console.warn(`
37+
---------------------------------------------------------------
38+
Warning: Skipping data URL for image dimensions in ${description.substring(0, 350)}...
39+
---------------------------------------------------------------
40+
`);
41+
42+
throw new Error('Data URL');
43+
}
3744
let imageDimensions = getCache(url);
3845
if (imageDimensions) return imageDimensions;
3946

0 commit comments

Comments
 (0)