-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(image): avoid under image #94
Comments
I have an idea... will see when I can find time |
@werthdavid nice! You can always let me know how you'd implement that and I can try on my own |
So the idea is to use a globalCompositeOperation of "destination-out" with a dummy image. |
@werthdavid I see the idea here and it does seems to be a pretty good one. (Also, they didn't change the code for over 5 years ) So if I do understand it correctly, we'd need to transition first kjua-svg. But maybe other ts frameworks folks could use a ts-kjua-svg library. I could get my hand on that today, what do you think? |
yeah well, actually we don't even need ts-kjua-svg IMHO. If there is a proper build process, a JS library can be used without hassle, typescript definitions are there already. If you like, you are more than welcome to create a PR on kjua-svg (I'm the owner there as well). |
@werthdavid Nice, I wasn't aware of it. But that said, i'm not sure I understand why you wanted to import the kjua-svg code in ngx-kjua then, if you're able to fix the error at the source. Can you create the required issue on the kjua-svg library and assign it to me ? (Or mention me in the issue). I'll have a look this afternoone. That said, I may need more time that you for the solution you've proposed with compositionOperation, as I'm actually specialised in Angular, but not the rest '^^ (But always eager to learn) |
I wanted to import the code because it would be the quicker (but dirty) solution. I forked kjua-svg from the original "kjua" only to have svg support but the whole project for me was only there to have the angular component. the original "kjua" now has svg support as well btw. so the clean way would be to fix kjua-svg, no doubt. If you want to implement the feature, I'd do the following:
|
@werthdavid Ah I see, so, the must would be to use So I'll implement it directly in Then, if we wish to migrate it to the official |
Careful! The original kjua (which is lrsjng/kjua) is not maintained anymore. My fork (werthdavid/kjua) is published as "kjua-svg" as I added svg support (later, lrsjng added svg support to the original lrsjng/kjua as well). I didn't switch back to the original kjua and kept my fork as I added the "Image as Code" option there. The logic of this option can be "safely inherited" (as I call "copy&paste") to implement this feature. So if I would do it, I would potentially:
OR:
does that make sense? |
@werthdavid Yeh, that warning also did get on my nerves. I think I've understood everything, I'll start right away, thx for the clarification |
@werthdavid I've done the ToDo
|
thank you @rbalet ! I will take a look! |
So the PoC works, but unfortunately only for canvas and img, my idea with "globalCompositeOperation" doesn't work with svg... is that a limitation you could live with? |
@werthdavid I'd say it is already better than nothing 😍. If you wish, I could add an implementation that throw an error when svf and glovalCompositieOperstion are used. And thx for the implementation, really appreciated |
I will merge the canvas/image option now and throw an error for svg. no big deal. I have an idea how it COULD work with svg but don't really have time these days. |
@werthdavid Np, it's already pretty good if you can push that one. Here, I've create an issue for the svg |
sorry for the delay, had some issues with the unit-test, the option is now available. please let me know if everything works with 18.1.0 |
@werthdavid No problem, thx a lot for doing it either way. That I've fixed right away in that pull request |
@werthdavid Can you show me where to add the Also, somehow we now get this error while importing (Funnily enough, this does work inside the |
add the what? 🙈 |
@werthdavid so Step to reproducein the kjua project
Somehow it seems like it is wrongly complied I have seen the following discussion : https://stackoverflow.com/questions/43946738/webpack-compile-error-typeerror-webpack-imported-module-1-is-not-a-funct It seems it could be due to the import I may think that this can be the problem. But I don't know how to import this one in a other manner.. |
@werthdavid Hey, I've tested the following fix. #99 I've let the For me, it seems to have fixed the issue. Can you please try out ? |
@Sergiobop Exactly |
@werthdavid I confirm that this is working. That said, this does not resolve this issue as the image is in the qr-code, and not cut out of it |
What settings did you provide for given code? |
@werthdavid Forget what I've said. Closing the issue as it works juste like it should. |
Description
Would it be doable to avoid rendering the middle of the qr-code ?
This would enable having gradient under the qr-code
The text was updated successfully, but these errors were encountered: