diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-09 14:33:12 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-09 14:33:12 +0100 |
| commit | fbf5e226ec9194ab67081cb9ecdd5f839cd87c3a (patch) | |
| tree | 9e5f272a5a362215fff478db0e90badf556f8a40 /lib/images.js | |
| parent | 1a495a98856180e25d3b166b51319b165e0ce348 (diff) | |
Check image content type for backslashes
Diffstat (limited to 'lib/images.js')
| -rw-r--r-- | lib/images.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/images.js b/lib/images.js index 40aa378..7c49dbe 100644 --- a/lib/images.js +++ b/lib/images.js @@ -29,3 +29,9 @@ exports.dataUri = imgElement(function(element) { }; }); }); + +function imageFilenameExtension(image) { + return image.contentType.split(/\/|\\/)[1]; +} + +exports.imageFilenameExtension = imageFilenameExtension; |
