Skip to content

Commit 710a4d1

Browse files
committed
remove debug code
1 parent d12910d commit 710a4d1

File tree

2 files changed

+8
-34
lines changed

2 files changed

+8
-34
lines changed

system/Images/Handlers/ImageMagickHandler.php

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -356,55 +356,43 @@ protected function supportedFormatCheck()
356356
*/
357357
public function save(?string $target = null, int $quality = 90): bool
358358
{
359-
echo "\n\nstart of save() with target: " . $target . " and quality: " . $quality . "\n";
360359
$original = $target;
361360
$target = ($target === null || $target === '') ? $this->image()->getPathname() : $target;
362-
echo "target is now: " . $target . "\n";
361+
363362
// If no new resource has been created, then we're
364363
// simply copy the existing one.
365364
if (! $this->resource instanceof Imagick && $quality === 100) {
366-
echo "instance not Imagick, quality: " . $quality . "\n";
367365
if ($original === null) {
368-
echo "original is null, return true\n";
369366
return true;
370367
}
371368

372369
$name = basename($target);
373370
$path = pathinfo($target, PATHINFO_DIRNAME);
374-
echo "return result from image()->copy()\nend of save()\n";
371+
375372
return $this->image()->copy($path, $name);
376373
}
377-
echo "ensureResource() call\n";
374+
378375
$this->ensureResource();
379-
echo "setImageCompressionQuality() call\n";
376+
380377
$this->resource->setImageCompressionQuality($quality);
381-
echo "if target is not null\n";
382-
var_dump($target);
378+
383379
if ($target !== null) {
384-
echo "target is not null\n";
385380
$extension = pathinfo($target, PATHINFO_EXTENSION);
386-
echo "setImageFormat() call\n";
387-
var_dump($extension);
388381
$this->resource->setImageFormat($extension);
389382
}
390-
echo "try...\n";
383+
391384
try {
392-
echo "writeImage() call\n";
393385
$result = $this->resource->writeImage($target);
394-
echo "result: \n";
395-
var_dump($result);
396386

397387
chmod($target, $this->filePermissions);
398388

399389
$this->resource->clear();
400390
$this->resource = null;
401-
echo "return result\nend of save()\n";
391+
402392
return $result;
403393
} catch (ImagickException) {
404-
echo "EXCEPTION\n";
405394
throw ImageException::forSaveFailed();
406395
}
407-
echo "last end of save()\n";
408396
}
409397

410398
/**

tests/system/Images/ImageMagickHandlerTest.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -436,21 +436,7 @@ public function testImageConvertPngToAvif(): void
436436
{
437437
$this->handler->withFile($this->origin . 'ci-logo.png');
438438
$this->handler->convert(IMAGETYPE_AVIF);
439-
$rc = $this->handler->save($this->root . 'ci-logo.avif');
440-
441-
echo "\n\n";
442-
var_dump($rc);
443-
var_dump($this->root);
444-
var_dump($this->root . 'ci-logo.avif');
445-
if (is_file($this->root . 'ci-logo.avif')) {
446-
echo "filesize: " . filesize($this->root . 'ci-logo.avif') . "\n";
447-
} else {
448-
echo "is_file fail\n";
449-
}
450-
var_dump(exif_imagetype($this->root . 'ci-logo.avif'));
451-
var_dump( IMAGETYPE_AVIF );
452-
echo "\n\n";
453-
439+
$this->handler->save($this->root . 'ci-logo.avif');
454440
$this->assertSame(IMAGETYPE_AVIF, exif_imagetype($this->root . 'ci-logo.avif'));
455441
}
456442

0 commit comments

Comments
 (0)