imaustink / gulp-inline-images

Gulp plugin for converting linked HTML images into base64 encoded inline images. Works with local and remote files.
4 stars 10 forks source link

Make http-inline optional #5

Closed danmindru closed 1 year ago

danmindru commented 6 years ago

Hi @imaustink, Regarding your comment, I think it's easier to understand what I did with the code if you look at the bigger picture. Essentially, I've made inlining http images optional (NB: default is false) and had to adjust the code a bit to make it work.


Here's the use case: I use this plugin for inlining images in HTML emails (here). Depending on what email clients people want to support, they might want to inline images or not.

All email clients support loading remote images, but only the modern ones support base64 images. As a result, in most cases when people use http they actually want the image to be loaded remotely and not inlined.

The 'inline' attribute (or having getHTTP = true as default for that matter) would break the code for everybody that used the HTML email generator before, so I'd rather avoid that.

Let me know if this makes sense to you. Apologies for not addressing this issue with you beforehand, it would have been more in line with the open source spirit IMO... but I was really in a hurry :)

Dan

imaustink commented 1 year ago

Thanks for your contribution! Sorry for the delayed response. I didn't know I had PRs awaiting approval.

danmindru commented 1 year ago

@imaustink np better late than never 😆