<?php
include_once('common.php');

$EXT      = 'jpg';
$SRC_DIR  = dirname(__FILE__) .'/pic_src';
$TMP_DIR  = dirname(__FILE__) .'/pic_tmp';
$MINI_DIR = dirname(__FILE__) .'/pic_mini';
$SIZE     = 30;

$conv = new ImageConverter();
$src_path_list = getPicPathList($SRC_DIR, $EXT);

//$SRC_DIRにある画像を縮小したものを、$TMP_DIRに作成
foreach ($src_path_list as $path) {
  $conv->createResizedImage($path, $TMP_DIR, $SIZE);
}

$tmp_path_list = getPicPathList($TMP_DIR, $EXT);

//$TMP_DIRにある画像から$SIZE四方を切り出したものを、$MINI_DIRに作成
foreach ($tmp_path_list as $path) {
  $conv->cropImage($path, $MINI_DIR, $SIZE, $SIZE);
}

