[TASK] Fixed a bug in the movePointer() function.

This commit is contained in:
Jan Philipp Timme
2011-01-03 15:27:03 +00:00
parent 61ea2b936e
commit b74c814e3f
3 changed files with 31 additions and 11 deletions
+4 -5
View File
@@ -29,7 +29,7 @@ class FileImageConverter {
* @return void
* @throws Exception
*/
public function convertFile($filename) {
public function convertFile($filename, $mode) {
if(file_exists($filename) === FALSE) throw new Exception("Invalid filename given!");
//get file data
@@ -56,9 +56,9 @@ class FileImageConverter {
$size = strlen($fancy_header) + 1 + strlen($filesize) + 1 + strlen($md5) + 1 + $filesize + 1;
//create and prepare image
$this->image = new BoxImage($size);
$this->image = new BoxImage($size, $mode);
echo "Image will be " . $this->image->getWidth() . "px x " . $this->image->getHeight() . "px.\n";
echo "Image will be " . $this->image->getWidth() . "px X " . $this->image->getHeight() . "px. (Mode: " . $mode . ")\n";
echo "Filling image...";
$this->image->fillImage(0,0,0,0);
@@ -92,9 +92,8 @@ class FileImageConverter {
echo "Adding file contents...\n";
$this->addDataToImage($content);
//magic pixel
//magic pixel - last pixel for line and bar mode, do NOT move pointer!
$this->image->setCurrentPixel(0,0,0,127);
$this->image->movePointer(1);
//save image
echo "Saving image...";