Git Product home page Git Product logo

Comments (6)

FrankFlitton avatar FrankFlitton commented on May 28, 2024

Thanks for sharing this. as far as your specific issues:

  1. Image distortion:
    I haven't encountered this, personally. Is the image set as a background image with css or with a or element?

  2. CORS:
    Thanks for the fix! I can incorporate it into the codebase.

Can you share some example code to reproduce you issue?

I'll release an (overdue) update once we can settle these issues.

from vue-2-img.

FrankFlitton avatar FrankFlitton commented on May 28, 2024

I encountered the image distortion when applying the CORS anonymous fix. It should be patched now, let me know if it's working for you. Version 0.0.5 is live on npm. https://www.npmjs.com/package/vue-2-img

from vue-2-img.

rcobiella avatar rcobiella commented on May 28, 2024

Thank you for the quick action!

Unfortunately I get this error now as soon as I execute the function, both using imports and the CDN

vue2img

from vue-2-img.

rcobiella avatar rcobiella commented on May 28, 2024

Hi again,

I took a moment to look at this, and got it to run by changing this:
document.querySelectorAll(target + ' img').forEach(function (imageNode, index) {

to this:
document.querySelectorAll('img').forEach(function (imageNode, index) {

Probably not the best performance though, but I just wanted to find a quick fix to see if it worked. Maybe target.querySelectorAll('img').forEach... is the right way?

Now that I got it to work I jumped into more problems though! Not in your code, but with html2canvas not rendering mix-blend-mode, and sizing images with object-fit incorrectly :. There's been plenty of issues opened throughout the years with workarounds to implement it in case you're interested in adding them!

object-fit: https://github.com/niklasvh/html2canvas/issues/725

mix-blend-mode: https://github.com/niklasvh/html2canvas/issues/580 + https://codepen.io/SevKel/pen/ZEOLPEg

from vue-2-img.

FrankFlitton avatar FrankFlitton commented on May 28, 2024

Thanks for checking that out and recommending a fix. I implemented the target container node then find img elements in the child nodes.

Yeah, html2canvas is great when it works. It's been sluggish to support some of the new HTML/CSS features. I've thought of maintaining a fork with some fixes/additions, depends on how large the scope of the project will get.

from vue-2-img.

FrankFlitton avatar FrankFlitton commented on May 28, 2024

0.0.6 is live now with the fix. I'll close the issue. Thanks again.

from vue-2-img.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.