|
@@ -130,18 +130,13 @@ public class SignageFileUtil {
|
|
|
String name = entry.getKey();
|
|
|
sortedMap.put(name, entry.getValue());
|
|
|
|
|
|
- //获取文件路径中的图的原始数据大小
|
|
|
- if (!sizeMap.containsKey(name)) {
|
|
|
- String sum = name.substring(0, name.lastIndexOf('/'));
|
|
|
- sizeMap.put(name, Integer.parseInt(sum));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
//整图的原始数据的大小 sizeMap 的value 总和
|
|
|
String fileName = null;
|
|
|
Integer ogSize = null;
|
|
|
|
|
|
- byte[] data = new byte[sizeMap.values().stream().mapToInt(Integer::intValue).sum()];
|
|
|
+ byte[] data1 = new byte[ SignageDrawUtil.height * SignageDrawUtil.width ] ;//默认使用完整图
|
|
|
|
|
|
int length = 0;
|
|
|
|
|
@@ -150,7 +145,7 @@ public class SignageFileUtil {
|
|
|
for (Map.Entry<String, byte[]> entry : sortedMap.entrySet()) {
|
|
|
fileName = entry.getKey();
|
|
|
|
|
|
- ogSize = Integer.parseInt(fileName.substring(0, fileName.lastIndexOf('/')));
|
|
|
+ ogSize = TypeCodeUtil.fileNameToLastFileSize(fileName);
|
|
|
|
|
|
byte[] dataBytes = entry.getValue();
|
|
|
|
|
@@ -160,7 +155,7 @@ public class SignageFileUtil {
|
|
|
MiniLZO.lzo1x_decompress(dataBytes, ogSize, dataBytes2, outL2);
|
|
|
|
|
|
// logger.info("解压缩后的长度 outLen len:" +outL2.v);
|
|
|
- System.arraycopy(dataBytes2, 0, data, length, outL2.v);
|
|
|
+ System.arraycopy(dataBytes2, 0, data1, length, outL2.v);
|
|
|
|
|
|
MiniLZOVo miniLZOVo = new MiniLZOVo();
|
|
|
miniLZOVo.setOgSize(ogSize);
|
|
@@ -171,9 +166,14 @@ public class SignageFileUtil {
|
|
|
length = length + ogSize;
|
|
|
|
|
|
}
|
|
|
+ byte[] data ;
|
|
|
+ if(length == SignageDrawUtil.height * SignageDrawUtil.width){
|
|
|
+ data = data1;
|
|
|
+ }else{
|
|
|
+ data = new byte[length ] ;
|
|
|
+ System.arraycopy(data1, 0, data, 0, data.length);
|
|
|
+ }
|
|
|
|
|
|
-// byte[] dataBytes33 = new byte[4];
|
|
|
-// System.arraycopy(data,data.length-4,dataBytes33,0,4);
|
|
|
|
|
|
byte[] dataBytes3 = new byte[data.length - 4];
|
|
|
System.arraycopy(data, 0, dataBytes3, 0, data.length - 4);
|
|
@@ -267,7 +267,7 @@ public class SignageFileUtil {
|
|
|
|
|
|
MiniLZOVo miniLZOVo = miniLZOVoList.get(i);
|
|
|
|
|
|
- sizeMap.put(miniLZOVo.getOgSize() + "/" + fileName, miniLZOVo);
|
|
|
+ sizeMap.put(fileName, miniLZOVo);
|
|
|
}
|
|
|
|
|
|
return sizeMap;
|