fix: Update inline image processing logic to fix missing images when multiple inline images present (#7861)

This commit is contained in:
Shivam Mishra
2023-09-06 14:35:19 +05:30
committed by GitHub
parent a8009c7b39
commit e529e1206e
5 changed files with 151 additions and 57 deletions

View File

@@ -4,44 +4,50 @@ Message-ID: <CAFkiBVzURp=z2g5nAevAtdQvFfxkLrpvTeDFcwFaGQhdo_-Mkg@mail.gmail.com>
Subject: New inline image test email conversation
From: Sony Mathew <sony@chatwoot.com>
To: "Replies" <reply+6bdc3f4d-0bed-4515-a284-5d916fdde489@example.com>
Content-Type: multipart/related; boundary="0000000000007a538405fcfa5967"
Content-Type: multipart/related; boundary="000000000000cade250604abfbe2"
--0000000000007a538405fcfa5967
Content-Type: multipart/alternative; boundary="0000000000007a538205fcfa5966"
--000000000000cade250604abfbe2
Content-Type: multipart/alternative; boundary="000000000000cade230604abfbe1"
--0000000000007a538205fcfa5966
--000000000000cade230604abfbe1
Content-Type: text/plain; charset="UTF-8"
[image: ptrol.jpeg]
HTML content and inline images
[image: poster (8).jpg][image: poster (7).jpg][image: poster (1).jpg]
--
*Tejaswini Chile.*
Software developer
*Mob:8485827731 | *@tejaswini_chile <https://twitter.com/tejaswini_chile>
--0000000000007a538205fcfa5966
--000000000000cade230604abfbe1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><img src=3D"cid:ii_libj9tsr0" alt=3D"ptrol.jpeg" width=3D"=
286" height=3D"508"><div><br></div><div>Let&#39;s add no HTML content here,=
just plain text and images<br><div><br></div><span class=3D"gmail_signatur=
e_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature" data-sma=
rtmail=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div=
><b>Tejaswini Chile.</b><br></div><span style=3D"font-family:times new roma=
n,serif"><span></span><span></span>Software developer</span><br></div><b>Mo=
b:8485827731 |=C2=A0</b><a href=3D"https://twitter.com/tejaswini_chile" tar=
get=3D"_blank">@tejaswini_chile</a></div></div></div></div></div></div>
<div dir=3D"ltr"><div>HTML content and inline images</div><img src=3D"=
cid:ii_lm7fuura0" alt=3D"poster (8).jpg" width=3D"542" height=3D"285"><img =
src=3D"cid:ii_lm7fuuvm1" alt=3D"poster (7).jpg" width=3D"542" height=3D"285=
"><img src=3D"cid:ii_lm7fuuwn2" alt=3D"poster (1).jpg" width=3D"542" height=
=3D"285"><br></div>
--0000000000007a538205fcfa5966--
--0000000000007a538405fcfa5967
Content-Type: image/jpeg; name="ptrol.jpeg"
Content-Disposition: inline; filename="ptrol.jpeg"
--000000000000cade230604abfbe1--
--000000000000cade250604abfbe2
Content-Type: image/jpeg; name="poster (8).jpg"
Content-Disposition: inline; filename="poster (8).jpg"
Content-Transfer-Encoding: base64
X-Attachment-Id: ii_libj9tsr0
Content-ID: <ii_libj9tsr0>
X-Attachment-Id: ii_lm7fuura0
Content-ID: <ii_lm7fuura0>
--0000000000007a538405fcfa5967--
--000000000000cade250604abfbe2
Content-Type: image/jpeg; name="poster (7).jpg"
Content-Disposition: inline; filename="poster (7).jpg"
Content-Transfer-Encoding: base64
X-Attachment-Id: ii_lm7fuuvm1
Content-ID: <ii_lm7fuuvm1>
--000000000000cade250604abfbe2
Content-Type: image/jpeg; name="poster (1).jpg"
Content-Disposition: inline; filename="poster (1).jpg"
Content-Transfer-Encoding: base64
X-Attachment-Id: ii_lm7fuuwn2
Content-ID: <ii_lm7fuuwn2>
--000000000000cade250604abfbe2--

View File

@@ -12,7 +12,7 @@ Content-Type: multipart/alternative; boundary="0000000000007a538205fcfa5966"
--0000000000007a538205fcfa5966
Content-Type: text/plain; charset="UTF-8"
[image: ptrol.jpeg]
[image: poster (8).jpg][image: poster (7).jpg][image: poster (1).jpg]
Let's add no HTML content here, just plain text and images
@@ -23,11 +23,27 @@ Software developer
--0000000000007a538405fcfa5967
Content-Type: image/jpeg; name="ptrol.jpeg"
Content-Disposition: inline; filename="ptrol.jpeg"
Content-Type: image/jpeg; name="poster (8).jpg"
Content-Disposition: inline; filename="poster (8).jpg"
Content-Transfer-Encoding: base64
X-Attachment-Id: ii_libj9tsr0
Content-ID: <ii_libj9tsr0>
X-Attachment-Id: ii_lm7fuura0
Content-ID: <ii_lm7fuura0>
--0000000000007a538405fcfa5967
Content-Type: image/jpeg; name="poster (7).jpg"
Content-Disposition: inline; filename="poster (7).jpg"
Content-Transfer-Encoding: base64
X-Attachment-Id: ii_lm7fuuvm1
Content-ID: <ii_lm7fuuvm1>
--0000000000007a538405fcfa5967
Content-Type: image/jpeg; name="poster (1).jpg"
Content-Disposition: inline; filename="poster (1).jpg"
Content-Transfer-Encoding: base64
X-Attachment-Id: ii_lm7fuuwn2
Content-ID: <ii_lm7fuuwn2>
--0000000000007a538405fcfa5967--