selectProductDetails($product); $isbn10 = $prodDetails->getIsbn10(); $giffile = $isbn10 . ".gif"; $jpgfile = $isbn10 . ".jpg"; $newjpg = $isbn10 . ".jpg"; $smallnewjpg = $isbn10 . "_small.jpg"; $folder = $new_image_path . substr($isbn10, 0, 3) . ""; $c_folder = $current_image_path . substr($isbn10, 0, 2) .""; if (!is_dir($folder)) { mkdir($folder); } if (file_exists($c_folder . "/" . $giffile)) { $old = $c_folder . "/" . $giffile; $new = $folder . $newjpg; $small = $folder . $smallnewjpg; $command = exec("/usr/bin/convert {$old} {$new}"); $command = exec("/usr/bin/convert -scale x100 {$old} {$small}"); } else if(file_exists($c_folder . "/" . $jpgfile)) { $old = $c_folder . "/" . $giffile; $new = $folder . $newjpg; $small = $folder . $smallnewjpg; $command = exec("/usr/bin/convert {$old} {$new}"); $command = exec("/usr/bin/convert -scale x100 {$old} {$small}"); } } ?>