mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
Ignore PSD parse image error
This commit is contained in:
parent
58d6082826
commit
68d3e7bffa
@ -130,12 +130,17 @@ function toCloudTextConfig(data: any, layer: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toCloudImageConfig(data: any, layer: any) {
|
function toCloudImageConfig(data: any, layer: any) {
|
||||||
// const { type, b64 } = splitBase64(layer.image.toBase64());
|
let src = []
|
||||||
// const src = URL.createObjectURL(b64toBlob(b64, type));
|
try {
|
||||||
|
src = layer?.image?.pixelData
|
||||||
|
} catch (error: any) {
|
||||||
|
if (error.message.includes('layer mask')) {
|
||||||
|
console.warn('图层蒙版不支持,尝试降级处理或简化PSD文件(逐步删除图层)定位问题元素')
|
||||||
|
} else console.error(error)
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
src: layer?.image?.pixelData,
|
// src: layer?.image?.pixelData,
|
||||||
// src: layer?.image?.toBase64(),
|
src,
|
||||||
// src: layer.image.toPng(),
|
|
||||||
type: CLOUD_TYPE.image,
|
type: CLOUD_TYPE.image,
|
||||||
width: data.width,
|
width: data.width,
|
||||||
height: data.height,
|
height: data.height,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user