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

The image rendered using the background image attribute has become blurred, and I have configured high resolution to make it unclear #3041

Open
007-liang opened this issue Mar 23, 2023 · 2 comments

Comments

@007-liang
Copy link

     <!-- Background-Image -->
    <div id="reference" style="display: inline-block; width: 20px; height: 20px;">
        <div style="background-image: url(https://img.coregem.net/img/user/avatar/random/14.png?imageView2/1/w/200/h/200); opacity: 1; width: 20px; height: 20px; background-size: cover;"></div>
        <!-- <img id="img" src="https://img.coregem.net/img/user/avatar/random/14.png?imageView2/1/w/200/h/200" width="100" height="100"> -->
    </div>

    <script type="text/javascript" src="../dist/html2canvas.min.js"></script>
    <script type="text/javascript">
        await html2canvas(reference, { scale: 4, allowTaint: true, useCORS:true }).then(function (canvas) {
            document.body.appendChild(canvas);
        });
    </script>

image

    <!-- This Img tag -->
    <div id="reference" style="display: inline-block; width: 20px; height: 20px;">
        <!-- <div style="background-image: url(https://img.coregem.net/img/user/avatar/random/14.png?imageView2/1/w/200/h/200); opacity: 1; width: 20px; height: 20px; background-size: cover;"></div> -->
        <img id="img" src="https://img.coregem.net/img/user/avatar/random/14.png?imageView2/1/w/200/h/200" width="20" height="20">
    </div>

    <script type="text/javascript" src="../dist/html2canvas.min.js"></script>
    <script type="text/javascript">
        html2canvas(reference, { scale: 4, allowTaint: true, useCORS:true }).then(function (canvas) {
            document.body.appendChild(canvas);
        });
    </script>

image

@007-liang
Copy link
Author

version: html2canvas 1.0.0-alpha.12

@Tingglelaoo
Copy link

version: html2canvas 1.0.0-alpha.12

@007-liang version 1.4.1 still caught this problem

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