We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am reading PSD like this :
import { readPsd , initializeCanvas } from "ag-psd"; initializeCanvas( (width, height) => { throw new Error("Canvas not supported in this environment"); }, undefined, (width, height) => ({ width, height, data: new Uint8ClampedArray(width * height * 4), // Allocate memory for ImageData colorSpace: "srgb", // Use sRGB color space }) ); const psd1 = readPsd(psdBuffer, { useRawThumbnail: true, useImageData: true, });
now I tried to upload image to s3 . ImageBytes is unit8Array , ( const imageBytes = new Uint8Array(obj.src); ) [obj.src contains unit8clampedArray]
const imageUrl = `${ENV.S3_API_BASE_URL}/${key}`; const blob = new Blob([imageBytes], { type: "image/png" }); const uploadResponse = await fetch(uploadURL, { method: "PUT", headers: { "Content-Type": "image/png", }, body: blob, }); if (!uploadResponse.ok) { throw new Error(`Upload failed: ${uploadResponse.statusText}`); }
I am getting empty output after uploading . Any Idea what might be the issue , or how to solve this ?
The text was updated successfully, but these errors were encountered:
Image data is raw bitmap color data, not an encoded PNG image. You need to encode it yourself.
Sorry, something went wrong.
Yep , worked now . Thanks again for always replying so fast .
Agamnentzar
No branches or pull requests
I am reading PSD like this :
now I tried to upload image to s3 . ImageBytes is unit8Array , ( const imageBytes = new Uint8Array(obj.src); ) [obj.src contains unit8clampedArray]
I am getting empty output after uploading . Any Idea what might be the issue , or how to solve this ?
The text was updated successfully, but these errors were encountered: