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

automated screenshots with phantomjs and image magick #269

Merged
merged 10 commits into from
Apr 23, 2014

Conversation

hutzelknecht
Copy link
Contributor

the screenshots can be taken by the following command

~$ . screenshots.sh http://geoext.github.io/geoext2/examples/

dependencies are phantomjs and imagemagick. The Script has been tested on an Ubuntu 13.04 machine.

@marcjansen
Copy link
Member

Great! Will test this now.

Do you see any chance of making jsuck.json on master look exactly as on gh-pages?

@marcjansen
Copy link
Member

For future pull requests (which I hope you'll be submitting plenty of), please work an explicit feature-branch.

@@ -0,0 +1,5 @@
exampleUrl = $1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better: exampleUrl=$1

No spaces around =

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@marcjansen
Copy link
Member

This is very nice, thanks a ton @hutzelknecht.

Some remarks.

  • I added a couple of comments to screenshot.sh and want to add some more here:

    • Could you please add #!/usr/bin/env bash as the first line of the script?
    • Could you make this script callable from everywhere by using absolute paths to example.js. The following lines may help:
    BASEDIR=$(dirname $0)
    WORKDIR=$(pwd -P)
    cd $BASEDIR
    BASEDIR=$(pwd -P)
    cd $WORKDIR
    • can you add a simple check whether phantomjs is available, sth. like:
    function chkcmd {
        which $1 >/dev/null
        if [ $? -ne 0 ];then
            echo "Program '$1' not found."
            exit 1
        fi
    }

    you can then just call this like chkcmd "phantomjs"

  • The screenshot.js-file should not use tabs and needs some love with regard to documentation, formatting, indentation and also should use curly-braces even for on-line branches.

  • I'd also put the two utility files into their own dedicated tools-folder on the root of the repo.

  • Please add a note in the main README.md how to regenerate the images.

  • Please try to make jsduck.json look exactly like it's counterpart on the gh-pages-branch

These are a lot of comments, I know. If you are able to address some of these I'd be very happy. If not, We can fix this in a follow-up pull request. Just tell me whether you agree and whether you have time for this.

To sum it up: Awesome work, @hutzelknecht! This will (in one way or the other) be merged once I have your feedback.

@hutzelknecht
Copy link
Contributor Author

Will fix the remaining remarks tonight.

@hutzelknecht
Copy link
Contributor Author

with a0b7492 everything should be fixed. @marcjansen could you please see if it still works on your machine?

@marcjansen
Copy link
Member

I will test this. But this has to wait until after Easter. I'll mostly be offline until next Tuesday.

phantomjs "$SCRIPTDIR/screenshots.js" $exampleUrl $SCRIPTDIR

# resize screenshots - requires imagemagick
for THUMB in $(find "$SCRIPTDIR/examples" | grep thumb.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work. I'll create a follow up PR to adress this.

@marcjansen
Copy link
Member

I added only one comment, which I'll address in a follow-up PR.

Thanks!

marcjansen added a commit that referenced this pull request Apr 23, 2014
automated screenshots with phantomjs and image magick
@marcjansen marcjansen merged commit e572395 into geoext:master Apr 23, 2014
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

Successfully merging this pull request may close these issues.

2 participants