Skip to content

Commit

Permalink
CLI tool half-tried to write a thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
howardjones committed Oct 9, 2018
1 parent db2bd1d commit c46c525
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Weathermap/Core/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ protected function writeImageFile($imageFileName, $imageRef)
*/
protected function createThumbnailFile($thumbnailFileName, $thumbnailMaxSize, $imageRef)
{
MapUtility::debug("Writing thumbnail to %s\n", $thumbnailFileName);
MapUtility::debug("Writing thumbnail to $thumbnailFileName\n");

if (!function_exists('imagecopyresampled')) {
MapUtility::warn("Skipping thumbnail creation, since we don't have the necessary function. [WMWARN17]");
Expand Down Expand Up @@ -1165,7 +1165,9 @@ public function drawMap(
imagepng($imageRef);
} else {
$this->writeImageFile($imageFileName, $imageRef);
$this->createThumbnailFile($thumbnailFileName, $thumbnailMaxSize, $imageRef);
if ($thumbnailFileName != '') {
$this->createThumbnailFile($thumbnailFileName, $thumbnailMaxSize, $imageRef);
}
}
}

Expand Down

0 comments on commit c46c525

Please sign in to comment.