Skip to content

Commit

Permalink
Merge pull request #75 from stloyd/patch-1
Browse files Browse the repository at this point in the history
Image pathname can be URL not only local file location
  • Loading branch information
eymengunay authored Jan 22, 2018
2 parents a913911 + 238fa52 commit cc3661b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Passbook/PassFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ private function preparePassDirectory(PassInterface $pass)

/**
* @param PassInterface $pass
* @param $passDir
* @param string $passDir
*/
private function prepareImages(PassInterface $pass, $passDir)
{
Expand All @@ -491,14 +491,16 @@ private function prepareImages(PassInterface $pass, $passDir)
} else if ($image->getDensity() === 3) {
$fileName .= '@3x';
}
$fileName .= '.' . $image->getExtension();

// Image pathname can be URL not only local file location
$fileName .= '.' . pathinfo(parse_url($image->getPathname(), PHP_URL_PATH), PATHINFO_EXTENSION);
copy($image->getPathname(), $fileName);
}
}

/**
* @param PassInterface $pass
* @param $passDir
* @param string $passDir
*/
private function prepareLocalizations(PassInterface $pass, $passDir)
{
Expand All @@ -524,6 +526,4 @@ private function prepareLocalizations(PassInterface $pass, $passDir)
}
}
}


}

0 comments on commit cc3661b

Please sign in to comment.