Giter Club home page Giter Club logo

Comments (11)

sdesalas avatar sdesalas commented on July 19, 2024

Hiya,

Thanks for the example and debug info. Will chase up when I get a mo.

from triflejs.

rajeshpaddy avatar rajeshpaddy commented on July 19, 2024

I'm having an issue with trifflejs similar to what is mentioned in this old post - ariya/phantomjs#10619.

I'm setting a viewport width of 1420 and height of 800. But the rendered image takes the width correctly but the height is 10425. This makes the document very narrow. I would use clipRect if that works?. Do you know when clipRect will be available for trifflejs?

from triflejs.

sdesalas avatar sdesalas commented on July 19, 2024

Hi @rajeshpaddy,

Can you copy/paste your testing script?

Thanks!

from triflejs.

rajeshpaddy avatar rajeshpaddy commented on July 19, 2024
var page = require('webpage').create();

page.zoomFactor=1;

page.onLoadFinished = function(e) {
     setTimeout(function(){
      page.render('msn.jpg',{quality:50});
      phantom.exit();},30000);
 };
page.viewportSize={width:1420,height:800};
console.log(page.viewportSize);
page.localT1oRemoteUrlAccessEnabled =true;

setTimeout(page.open('http://www.msn.com', function() {}),30000);

msn

from triflejs.

rajeshpaddy avatar rajeshpaddy commented on July 19, 2024
In the above example the height is coming out as 5344. I expect it to 800.

from triflejs.

sdesalas avatar sdesalas commented on July 19, 2024

Screenshot and test script received with thanks. Will get to it as soon as I can turn attention back to rendering functionality.

By the way this is related to page.viewportSize, which is a separate issue to one logged by @juliensobrier, in the future kindly open a separate ticket. Thanks.

from triflejs.

sdesalas avatar sdesalas commented on July 19, 2024

Hi @juliensobrier.

Sorry for taking so long to get back, I think your issue should have been fixed after commit 125e7a0. This was repairing a call to window.navigator (using page._evaluate()) before the document had been initialized. Could you try again?

Thanks!

from triflejs.

sdesalas avatar sdesalas commented on July 19, 2024

HI @rajeshpaddy, @juliensobrier.

Try your scripts after fix for frame recursion, should help when rendering websites.

BTW @rajeshpaddy. I'm still to look into page.viewportSize, I have a feeling that the current functionality is the same as phantomJS (ie that rendered screenshots are not limited by viewport size but always render the whole page). I could be wrong though..

from triflejs.

sdesalas avatar sdesalas commented on July 19, 2024

Hi @rajeshpaddy,

I just checked phantomJS and the script you sent me outputs a file `msn.jpg' that is 1420 x 2444. There is no issue here.. just your own expectation (although I have to admit this is what I thought phantom would do originally when I first wrote the API).

from triflejs.

juliensobrier avatar juliensobrier commented on July 19, 2024

@sdesalas http://livedoor.com/ still hangs TriffleJS

from triflejs.

sdesalas avatar sdesalas commented on July 19, 2024

Seems ok for me, try using the --render=http://livedoor.com option on latest binary.

C:\TrifleJS>TrifleJS.exe --render=http://livedoor.com
Rendering http://livedoor.com...
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png

C:\TrifleJS>

I have to do a bit of work on the event listeners (this is firing many times - probably due to iframes on adverts) but its not hanging and rendering seems ok as far as I can tell (the output png looks good). I haven't tested the page.open() page.render() process, and have the feeling that the hanging will still apply if you execute a JS script to do this, however the availability of a working --render CLI option means it'll be quicker to fix this.

from triflejs.

Related Issues (20)

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.