Skip to content

Commit

Permalink
fix: expand logic to send image as base64 encoded raw data
Browse files Browse the repository at this point in the history
  • Loading branch information
sandro-imhof committed Feb 1, 2024
1 parent 68fd2f2 commit 75ab41c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Services/ImageDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public function encodeImage(string $imagePath): string
{
$image = file_get_contents($imagePath);
//Encode the image to base64 and remove the prefix to get raw data
$imageData = base64_encode($image);
return preg_replace('#^data:image/[^;]+;base64,#', '', $imageData);
$rawData = base64_encode($image);

return $rawData;
}
}

0 comments on commit 75ab41c

Please sign in to comment.