polotno-project / polotno-board

Roadmap and bug-tracker for the Polotno project.
https://polotno.dev/
9 stars 1 forks source link

polotno-node doesn't render image properly #30

Closed iamsterdam800 closed 2 years ago

iamsterdam800 commented 2 years ago

Trying to use polotno-node package for backend automation. Noticed these bugs in jsonToImageBase64(json, attrs) function:

These (hacky) modifications helped, but would be highly appreciated to have an official fix: image

Additionally, pixelRatio attribute does not seem to scale svg elements. Although handles fonts just fine. image (svg on the left, text on the right)

lavrton commented 2 years ago

setting pixelRatio in attrs does not have effect, because attrs are not passed to store.toDataURL() function

You are right. It was a bug. It should be fixed now. I published polotno-node@0.1.12 with the fix.

some images (especially the background) are rendered as white rectangles, because store.waitLoading() returns as soon as the 1st image is loaded?

There was a bug with loading check for the background. It should be fixed with the last polotno version (already included in the last polotno-node). I am not sure about other cases with image. Can you check it, please? If you still see the issue, please provide json example.

Additionally, pixelRatio attribute does not seem to scale svg elements. Although handles fonts just fine.

You are right. It should be fixed now. Please check the last version.

Thanks a lot for the report.

iamsterdam800 commented 2 years ago

Hi Anton, thanks a lot for the fixes! I re-tested each issue with v.0.1.12 and everything seems to work perfectly fine!