#!/bin/sh

# sh, bash and dash compatible test script
# Date      : November 2006
# Goal      : Create folder in homedir with lots of png files 
#             to test nautilus' preview, which sometimes takes a lot of time.
# Depends on: imagemagick


# Test for timing when switching between the two folders.
# 500 jpg files icon view   4 seconds
# 500 jpg files list view   4 seconds
# 500 png files icon view  54 second
# 500 png files list view  78 seconds


# Test for timing with png files and icon view when switching between the two folders.
# 100 png files    12 seconds
# 200 png files    22 seconds
# 300 png files    33 seconds
# 400 png files    43 seconds
# 500 png files    53 seconds


# Test for timing with 'reload' button
# 500 jpg files icon view   1 second
# 500 jpg files list view   1...4 seconds
# 500 png files icon view   1 second
# 500 png files list view  75 seconds
# 100 jpg files icon view   1 second
# 100 jpg files list view   1 second
# 100 png files icon view   1 second
# 100 png files list view  13 seconds


DIRVAR=$HOME/testpng`date +%Hh%Mm%Ss`
mkdir $DIRVAR
convert -size 1000x1000 xc:none -fill black -draw 'rectangle 0,0,999,999' -fill white -draw 'rectangle 200,200,800,800' -fill black -draw 'rectangle 400,400,600,600' -flatten $DIRVAR/x1000.png

for i in `seq 1001 1500`;
do
  cp $DIRVAR/x1000.png $DIRVAR/x$i.png
done

DIRVAR=$HOME/testjpg`date +%Hh%Mm%Ss`
mkdir $DIRVAR
convert -size 1000x1000 xc:none -fill black -draw 'rectangle 0,0,999,999' -fill white -draw 'rectangle 200,200,800,800'  -fill black -draw 'rectangle 400,400,600,600' -flatten $DIRVAR/x1000.jpg

for i in `seq 1001 1500`;
do
  cp $DIRVAR/x1000.jpg $DIRVAR/x$i.jpg
done
