Skip to content
New issue

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

Resizing results in overlapping images. #12

Open
SpiGAndromeda opened this issue May 8, 2020 · 7 comments
Open

Resizing results in overlapping images. #12

SpiGAndromeda opened this issue May 8, 2020 · 7 comments

Comments

@SpiGAndromeda
Copy link

SpiGAndromeda commented May 8, 2020

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    When Resizing images the resize function in resize.js draws in a loop to the same canvas. This can result in multiple overlapping images (with different size) on the same canvas. The cropping function at the end doesn't remove them.

  • Other information
    I will do a forx and see how to fix it nicely. My first working approach (local) was to uzitlize the helperCamvas of the canvasService. I think a new function in the canvasService will do this nicely.

best regards,
spigandromeda

P.S. this is a really nice package. Good work!

@SpiGAndromeda
Copy link
Author

Fork with fix at SpiGAndromeda/ts-image-processor .

@MickL
Copy link
Owner

MickL commented May 8, 2020

If you already fixed it, could you make a PR? THANK YOU!! :)

@SpiGAndromeda
Copy link
Author

@MickL Done. Very fast response. Nice!

@MickL
Copy link
Owner

MickL commented May 8, 2020

I am not exactly sure how to reproduce the overlapping images. Could you give me instructions so I can understand the problem?

@SpiGAndromeda
Copy link
Author

Of cause:

I am using your library together with html2canvas and image skewing (btw. something that could be implemented in here, too ;) ... or which I could do) to create an image with 3d transformed text. The skewing, unfortunatly produces ugly artifacts. Thats why I create a bigger text canvas (10x) and reduce it's size with your library. Supersampling.

Images with and without fix are attached. Same "supersampling-factor" used.
without-fix
with-fix

@MickL
Copy link
Owner

MickL commented May 8, 2020

Can you reproduce it on the demo page?

Please note there seems to be a bug I just found that it only accepts jpg

@SpiGAndromeda
Copy link
Author

Just JPEGs? Ok. I used a JPEG of the pure text but the result was ok in demo.
@MickL you want to fix the demo first?

Also note that the demo uses default options in the source pipe, which means that data URLs are extracted from canvas as JPEG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants