xiatian vor 5 Jahren
Ursprung
Commit
5692f21534

+ 7 - 7
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/util/ExportPaperUtil.java

@@ -375,7 +375,7 @@ public class ExportPaperUtil {
 					SectionElementParams sep = se.getParam();
 					sep.setHeight(getHeight(ce));
 					sep.setWidth(getWidth(ce));
-					
+
 					setImageSizeForNone(se);
 				} else {
 					Element el = (Element) ce;
@@ -390,26 +390,26 @@ public class ExportPaperUtil {
 	private static void setImageSizeForNone(SectionElement se) {
 		if (se.getParam().getHeight() == 0 || se.getParam().getWidth() == 0) {
 			String base64 = se.getValue().substring(se.getValue().indexOf(",") + 1);
-			InputStream in=null;
+			InputStream in = null;
 			try {
 				byte[] decoderBytes = new BASE64Decoder().decodeBuffer(base64);
 				in = new ByteArrayInputStream(decoderBytes);
 
 				BufferedImage ImageOne = ImageIO.read(in);
 				// 可以获得宽和高了
-				se.getParam().setHeight(ImageOne.getHeight());
-				se.getParam().setWidth(ImageOne.getWidth());
+				se.getParam().setHeight(ImageOne.getHeight() * docImageSzie);
+				se.getParam().setWidth(ImageOne.getWidth() * docImageSzie);
 			} catch (IOException e) {
 				throw new ExamCloudRuntimeException(e);
-			}finally {
-				if(in!=null) {
+			} finally {
+				if (in != null) {
 					try {
 						in.close();
 					} catch (IOException e) {
 					}
 				}
 			}
-			
+
 		}
 	}