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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: canvas_bench/images/generate_images.sh
===================================================================
--- canvas_bench/images/generate_images.sh (revision 0)
+++ canvas_bench/images/generate_images.sh (revision 0)
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
jbates 2012/02/17 19:54:30 nit: 2012
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Utility to generate random images using ImageMagick
+
+MIN_DIM=75
+MAX_DIM=100
+NUM_IMAGES=1000
+
+for (( i = 1; i <= NUM_IMAGES; ++i )) do
+ # Generate a random binary 0/1.
+ rand_bin=$(( $RANDOM % 2 ))
+ # Generate a random number in the range [MIN_DIM, MAX_DIM].
+ rand_dim=$(( MIN_DIM + ($RANDOM % (MAX_DIM - MIN_DIM + 1)) ))
+
+ # Generate a dimension such that one side is equal to MAX_DIM
+ # and the other is a random number in the range [MIN_DIM, MAX_DIM].
+ width=$(( (rand_bin * MAX_DIM) + ((1 - rand_bin) * rand_dim) ))
+ height=$(( ((1 - rand_bin) * MAX_DIM) + (rand_bin * rand_dim) ))
+
+ # Generate a random image
+ convert -size ${width}x${height} plasma:fractal image$i.png
+done
Property changes on: canvas_bench\images\generate_images.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:eol-style
+ LF
« 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