currentfeature/docs
Last change
on this file since 3169fe4 was
3169fe4,
checked in by Borja Lopez <borja@…>, 5 years ago
|
Set proper permissions on bin/js_deps and bin/screenshot_map
|
-
Property mode set to
100755
|
File size:
855 bytes
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | # |
---|
3 | # Make a screenshot of a workout map |
---|
4 | # |
---|
5 | |
---|
6 | uid=$1 |
---|
7 | wid=$2 |
---|
8 | dest=$3 |
---|
9 | dummy=$4 |
---|
10 | |
---|
11 | # make a dummy screenshot image first, that way if chrome fails, we still have an image |
---|
12 | cp ${dummy} screenshot.png |
---|
13 | |
---|
14 | # Make the screenshot with chrome headless |
---|
15 | `which chrome` --headless --disable-gpu --window-size="1300x436" --screenshot http://localhost:9999/${uid}/${wid}/map --virtual-time-budget=10000 |
---|
16 | |
---|
17 | # crop it |
---|
18 | # `which convert` screenshot.png -chop 100x0 ${dest} |
---|
19 | |
---|
20 | # resize, 70% of the original image is enough. |
---|
21 | # we do this instead of setting a lower resolution/window size on the browser |
---|
22 | # because with smaller window size, the resulting images appear corrupted |
---|
23 | # randomly (like if the screenshot was taking before the map was finished |
---|
24 | # loading tiles) |
---|
25 | # `which convert` ${dest} -resize 70% ${dest} |
---|
26 | |
---|
27 | # remove leftover |
---|
28 | # rm screenshot.png |
---|
29 | mv screenshot.png ${dest} |
---|
Note: See
TracBrowser
for help on using the repository browser.