[Bps-public-commit] RTx-TakeScreenshots branch, master, updated. 515b8b6d7167fc8d5371dea9034a00c2305cac3b

Thomas Sibley trs at bestpractical.com
Tue Mar 8 12:08:24 EST 2011


The branch, master has been updated
       via  515b8b6d7167fc8d5371dea9034a00c2305cac3b (commit)
       via  11f2765b8d7391d10b50f6f9c716554de325f647 (commit)
       via  a62efb6f452af437bc4e4294522912e016010234 (commit)
      from  f714ffcc5c3d71145b5c93f4c2ad0e4febcdc651 (commit)

Summary of changes:
 bin/crop-screenshot     |   13 +++++++++++++
 bin/process-screenshots |   12 ++++++++++++
 bin/shadow-screenshot   |   17 +++++++++++++++++
 bin/take-screenshots    |    2 +-
 etc/initialdata         |    4 ++++
 5 files changed, 47 insertions(+), 1 deletions(-)
 create mode 100755 bin/crop-screenshot
 create mode 100755 bin/process-screenshots
 create mode 100755 bin/shadow-screenshot

- Log -----------------------------------------------------------------
commit a62efb6f452af437bc4e4294522912e016010234
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Mar 8 11:57:50 2011 -0500

    Bump up the width

diff --git a/bin/take-screenshots b/bin/take-screenshots
index 218a12e..caf2b77 100755
--- a/bin/take-screenshots
+++ b/bin/take-screenshots
@@ -40,7 +40,7 @@ $firefox->submit('id=login');
 # Hack to resize the browser window.  Width is what we really care about, since
 # the screenshots are stitched together vertically to capture the entire page.
 my ($title) = $firefox->get_all_window_titles;
-system qq[wmctrl -r "$title - Mozilla Firefox" -e 0,0,0,953,700];
+system qq[wmctrl -r "$title - Mozilla Firefox" -e 0,0,0,975,700];
 $firefox->pause(2000); # give wmctrl time to catch up
 
 # Save the subscription so we see it on the homepage

commit 11f2765b8d7391d10b50f6f9c716554de325f647
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Mar 8 12:05:32 2011 -0500

    Add the utility commands to crop and drop shadow the screenshots
    
    These require ImageMagick's command line utilities.
    
    Run ./bin/process-screenshots with the same directory you set --output
    to when you can ./bin/take-screenshots.

diff --git a/bin/crop-screenshot b/bin/crop-screenshot
new file mode 100755
index 0000000..7960494
--- /dev/null
+++ b/bin/crop-screenshot
@@ -0,0 +1,13 @@
+#!/bin/bash
+in="$1"
+out="${2:-${1%.*}-cropped.${1#*.}}"
+
+# The very large width means the width should never be cropped.  The > means
+# only crop if one of the dimensions is exceeded, so images with a height less
+# than 740px won't be cropped.
+geometry="1024x740>+0+0"
+
+convert "$in" -crop "$geometry" +repage "$out"
+
+echo "Cropped $in"
+
diff --git a/bin/process-screenshots b/bin/process-screenshots
new file mode 100755
index 0000000..e330a12
--- /dev/null
+++ b/bin/process-screenshots
@@ -0,0 +1,12 @@
+#!/bin/bash
+dir="$1"
+
+mkdir -v "$dir/crop"
+mkdir -v "$dir/shadow"
+
+for orig in "$dir"/*.png; do
+    file=`basename "$orig"`
+    ./bin/crop-screenshot "$orig" "$dir/crop/$file"
+    ./bin/shadow-screenshot "$dir/crop/$file" "$dir/shadow/$file"
+done
+
diff --git a/bin/shadow-screenshot b/bin/shadow-screenshot
new file mode 100755
index 0000000..f84bca1
--- /dev/null
+++ b/bin/shadow-screenshot
@@ -0,0 +1,17 @@
+#!/bin/bash
+in="$1"
+out="${2:-${1%.*}-shadow.${1#*.}}"
+opacity=50
+spread=14
+offset="+0+0"
+
+# In order to make the pixels outside of the rounded corner transparent, I
+# greenscreened them by setting my background to #00ff00.  There's a little
+# blending happening, so I masked #00ff00 and #00fe00 out.
+
+convert "$in" -transparent "#00ff00" -transparent "#00fe00" \
+    \( +clone -background black -shadow ${opacity}x${spread}$offset \) \
+    +swap -background white -layers merge +repage "$out"
+
+echo "Drop shadowed $in"
+

commit 515b8b6d7167fc8d5371dea9034a00c2305cac3b
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Mar 8 12:07:07 2011 -0500

    Add some content to the "Order more coffee" ticket

diff --git a/etc/initialdata b/etc/initialdata
index 9360f12..d2a864a 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -70,6 +70,10 @@ our @Tickets = (
         Requestor   => 'jesse',
         Owner       => 'jesse',
         DependsOn   => [ 3, 4 ],
+        Content     => <<'.',
+In accordance with corporate policy, we need to choose roasts from last month's
+RFP sent out to the vendors.
+.
     },
     {
         Queue       => 'General',

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list