Skip to content

Commit

Permalink
Clear error when fetching image
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage committed Feb 18, 2024
1 parent b404bb0 commit 9d65597
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Service/ImageFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function getImageHash(string $url): ?string
$contentType = $response->getHeaders(false)['content-type'][0] ?? '';
if (str_starts_with($contentType, 'image/')) {
$image = @imagecreatefromstring($response->getContent());
error_clear_last();
if ($image !== false) {
$cacheItem->set(
$this->imageComparator->convertHashToBinaryString(
Expand Down

0 comments on commit 9d65597

Please sign in to comment.