before merge

This commit is contained in:
jinye_huang 2025-08-04 13:52:11 +08:00
parent 3cf105a88c
commit 9af740a21d

View File

@ -302,27 +302,17 @@ class PosterService:
image_io.seek(0)
images = Image.open(image_io)
<<<<<<< HEAD
logger.info(f"✅ 图片解码成功,格式: {images.format}, 尺寸: {images.size}, 模式: {images.mode}")
=======
logger.info(f"✅ 图片解码成功,格式: {images.format}, 原始尺寸: {images.size}, 模式: {images.mode}")
# 处理图片尺寸,调整到目标尺寸 1350x1800
images = self._resize_and_crop_image(images, target_width=1350, target_height=1800)
>>>>>>> bfef3a3974fd587b9bd1fcad5902a472b613b86d
except binascii.Error as e:
logger.error(f"❌ Base64解码失败: {e}")
logger.error(f"问题数据长度: {len(first_image_base64) if 'first_image_base64' in locals() else 'unknown'}")
<<<<<<< HEAD
# 创建一个与目标大小一致的透明底图
images = Image.new('RGBA', template_size, color=(0, 0, 0, 0))
logger.info(f"创建默认透明背景图,尺寸: {template_size}")
=======
# 创建一个与目标大小一致的透明底图 (1350x1800)
images = Image.new('RGBA', (1350, 1800), color=(0, 0, 0, 0))
logger.info(f"🔧 创建默认透明背景图,尺寸: {images.size}")
>>>>>>> bfef3a3974fd587b9bd1fcad5902a472b613b86d
except Exception as e:
logger.error(f"❌ 图片处理失败: {e}")
logger.error(f"错误类型: {type(e).__name__}")
@ -333,15 +323,9 @@ class PosterService:
logger.info(f"🔧 创建默认透明背景图,尺寸: {images.size}")
else:
logger.warning("⚠️ 未提供图片数据,使用默认透明背景图")
<<<<<<< HEAD
# 创建一个与目标大小一致的透明底图
images = Image.new('RGBA', template_size, color=(0, 0, 0, 0))
logger.info(f"创建默认透明背景图,尺寸: {template_size}")
=======
# 创建一个与目标大小一致的透明底图 (1350x1800)
images = Image.new('RGBA', (1350, 1800), color=(0, 0, 0, 0))
logger.info(f"🔧 创建默认透明背景图,尺寸: {images.size}")
>>>>>>> bfef3a3974fd587b9bd1fcad5902a472b613b86d
# 4. 调用模板生成海报
try: