|
@@ -391,13 +391,15 @@ public class ExamServiceImpl implements ExamService {
|
|
|
if(imgs!=null) {
|
|
|
for(Element img:imgs) {
|
|
|
String src=img.attr("src");
|
|
|
- String base64=src.split(",")[1];
|
|
|
- int equalIndex= base64.indexOf("=");
|
|
|
- if(equalIndex>0){
|
|
|
- base64=base64.substring(0, equalIndex);
|
|
|
+ if(src.startsWith("data:")) {
|
|
|
+ String base64=src.split(",")[1];
|
|
|
+ int equalIndex= base64.indexOf("=");
|
|
|
+ if(equalIndex>0){
|
|
|
+ base64=base64.substring(0, equalIndex);
|
|
|
+ }
|
|
|
+ long fileSize=base64.length()-(base64.length()/8)*2;
|
|
|
+ size=size+fileSize;
|
|
|
}
|
|
|
- long fileSize=base64.length()-(base64.length()/8)*2;
|
|
|
- size=size+fileSize;
|
|
|
}
|
|
|
}
|
|
|
}
|