Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: canvas_bench/images/generate_images.sh

Issue 9419023: Added a script to download images from flickr. The images are public and have appropriate creative … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 #!/bin/bash
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
jbates 2012/02/17 19:54:30 nit: 2012
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 # Utility to generate random images using ImageMagick
7
8 MIN_DIM=75
9 MAX_DIM=100
10 NUM_IMAGES=1000
11
12 for (( i = 1; i <= NUM_IMAGES; ++i )) do
13 # Generate a random binary 0/1.
14 rand_bin=$(( $RANDOM % 2 ))
15 # Generate a random number in the range [MIN_DIM, MAX_DIM].
16 rand_dim=$(( MIN_DIM + ($RANDOM % (MAX_DIM - MIN_DIM + 1)) ))
17
18 # Generate a dimension such that one side is equal to MAX_DIM
19 # and the other is a random number in the range [MIN_DIM, MAX_DIM].
20 width=$(( (rand_bin * MAX_DIM) + ((1 - rand_bin) * rand_dim) ))
21 height=$(( ((1 - rand_bin) * MAX_DIM) + (rand_bin * rand_dim) ))
22
23 # Generate a random image
24 convert -size ${width}x${height} plasma:fractal image$i.png
25 done
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698