印花坐标修改

This commit is contained in:
xupei
2023-09-21 13:44:39 +08:00
parent e1b3c20131
commit dcd4ce584c
4 changed files with 14 additions and 10 deletions

View File

@@ -1390,11 +1390,10 @@ public class PythonService {
List<Float> angle = new ArrayList<>(printObject.getPrints().size());
// 设置印花的位置、大小、旋转角度
// todo 空指针
List<DesignSinglePrint> prints = printObject.getPrints();
prints.forEach(p -> {
p.getLocation().set(0,p.getLocation().get(0) * fileVO.getWidth());
p.getLocation().set(1,p.getLocation().get(1) * fileVO.getHigh());
p.getLocation().set(0,p.getLocation().get(0));
p.getLocation().set(1,p.getLocation().get(1));
Integer priority = p.getPriority();
location.add(priority - 1, p.getLocation());
scale.add(priority - 1,p.getScale());
@@ -1719,10 +1718,10 @@ public class PythonService {
private static List<String> setGenerateImageList(JSONObject jsonObject){
List<String> imageUrlList = JSONObject.parseArray(jsonObject.get("list").toString(),String.class);
if (imageUrlList.size() == 0){
if (imageUrlList.isEmpty()){
log.error("PythonService##generateSketchOrPrint异常###{}","diffusion response list is null");
// todo 如果这里返回为空,是判断出错还是返回给前端空
throw new BusinessException("Some errors occurred, please try again later");
throw new BusinessException("The data returned on the python side is empty");
}
return imageUrlList;