Skip to content

Commit

Permalink
Add support for image/jpeg mimetype (#1742)
Browse files Browse the repository at this point in the history
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 <seth@falco.fun>
  • Loading branch information
abejfehr and SethFalco committed Sep 24, 2023
1 parent bd750ce commit 437c09b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/removeRasterImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 437c09b

Please sign in to comment.