mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
code: fix psd reading fail image
This commit is contained in:
parent
2878064b76
commit
cba825cdbf
@ -3,9 +3,11 @@
|
||||
* @Date: 2024-08-17 18:45:24
|
||||
* @Description:
|
||||
* @LastEditors: ShawnPhang <https://m.palxp.cn>
|
||||
* @LastEditTime: 2024-08-17 18:46:58
|
||||
* @LastEditTime: 2024-08-18 20:49:49
|
||||
*/
|
||||
export function createBase64(src: any, { width, height }: any) {
|
||||
let result = ''
|
||||
if (src && width) {
|
||||
const canvas = document.createElement('canvas')
|
||||
canvas.width = width
|
||||
canvas.height = height
|
||||
@ -17,5 +19,7 @@ export function createBase64(src: any, { width, height }: any) {
|
||||
pixelData[i] = src[i]
|
||||
}
|
||||
context.putImageData(imageData, 0, 0)
|
||||
return canvas.toDataURL('image/png')
|
||||
result = canvas.toDataURL('image/png')
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @Date: 2022-01-10 14:57:53
|
||||
* @Description: Psd文件解析
|
||||
* @LastEditors: ShawnPhang <https://m.palxp.cn>
|
||||
* @LastEditTime: 2024-08-17 18:53:35
|
||||
* @LastEditTime: 2024-08-18 21:06:05
|
||||
-->
|
||||
<template>
|
||||
<div id="page-design-index" ref="pageDesignIndex">
|
||||
|
Loading…
x
Reference in New Issue
Block a user