fix(fb2): use base64 decoder aware of newlines (#2229)

This commit is contained in:
James Ward
2026-08-04 19:39:30 -04:00
committed by GitHub
parent b18c444605
commit 027ac6ca3c
2 changed files with 19 additions and 2 deletions
@@ -51,7 +51,7 @@ public class Fb2MetadataExtractor implements FileMetadataExtractor {
String contentType = binary.getAttribute("content-type");
if (contentType != null && contentType.startsWith("image/")) {
String base64Data = binary.getTextContent().trim();
return Base64.getDecoder().decode(base64Data);
return Base64.getMimeDecoder().decode(base64Data);
}
}
}
@@ -73,7 +73,7 @@ public class Fb2MetadataExtractor implements FileMetadataExtractor {
Element binary = (Element) binaries.item(i);
if (imageId.equals(binary.getAttribute("id"))) {
String base64Data = binary.getTextContent().trim();
return Base64.getDecoder().decode(base64Data);
return Base64.getMimeDecoder().decode(base64Data);
}
}
}