From 437c09b006e058d200f2b74121bab65d9b7598ab Mon Sep 17 00:00:00 2001 From: Abe Fehr Date: Sun, 24 Sep 2023 08:32:13 -0400 Subject: [PATCH] Add support for image/jpeg mimetype (#1742) In practice, this plugin does not work to remove embedded jpg images. On further inspection, it's because the plugin is looking for image/jpg, which I'm not even sure is a valid mimetype. Inkscape uses image/jpeg as the mimetype for embedded JPG images. Co-authored-by: Seth Falco --- plugins/removeRasterImages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/removeRasterImages.js b/plugins/removeRasterImages.js index 8a3635318..1a4a4a12e 100644 --- a/plugins/removeRasterImages.js +++ b/plugins/removeRasterImages.js @@ -21,7 +21,7 @@ exports.fn = () => { if ( node.name === 'image' && node.attributes['xlink:href'] != null && - /(\.|image\/)(jpg|png|gif)/.test(node.attributes['xlink:href']) + /(\.|image\/)(jpe?g|png|gif)/.test(node.attributes['xlink:href']) ) { detachNodeFromParent(node, parentNode); }