diff --git a/FileImageConverter.class.php b/FileImageConverter.class.php index caabc67..80c2431 100644 --- a/FileImageConverter.class.php +++ b/FileImageConverter.class.php @@ -90,6 +90,7 @@ class FileImageConverter { $this->image->setCurrentPixel($r, $g, $b, 0); //move the pointer $this->image->movePointer(1); + $this->progressBar($i, $strlen); } } catch (Exception $e) { @@ -97,7 +98,19 @@ class FileImageConverter { echo "Caught Exception:\n"; echo $e; } + echo "\rDone.\n"; + } + /** + * Displays a simple progressbar using \r + * @param int $x + * @param int $total + * @return void + */ + protected function progressBar($x, $total) { + $percent = round($x / $total * 100, 2); + echo " \r"; + echo "Working... " . $percent . " %"; } } diff --git a/result.png b/result.png new file mode 100644 index 0000000..7048b5a Binary files /dev/null and b/result.png differ diff --git a/test.jpg b/test.jpg index 6ee6d4b..578815a 100644 Binary files a/test.jpg and b/test.jpg differ