@@ -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() \n end 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 \n end 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 /**
0 commit comments