Skip to content

Commit

Permalink
Add error log for no inline image match
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrussler committed May 31, 2024
1 parent 2e13b16 commit 6a55d1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/mimeparser/MimeMessageConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static void convertToPdf(String emailFilePath, String pdfOutputPath, bool
/* ######### Embed images in the html ######### */
String htmlBody = bodyEntry.getEntry();
if (bodyEntry.getContentType().match("text/html")) {
if (inlineImageMap.size() > 0) {
if (!inlineImageMap.isEmpty()) {
Logger.debug("Embed the referenced images (cid) using <img src=\"data:image ...> syntax");

// find embedded images and embed them in html using <img src="data:image ...> syntax
Expand All @@ -201,6 +201,8 @@ public String replace(Matcher m) throws Exception {

// found no image for this cid, just return the matches string as it is
if (base64Entry == null) {
Logger.error("Found no inline image for cid: %s", cid);

return m.group();
}

Expand Down

0 comments on commit 6a55d1f

Please sign in to comment.