mirror of
https://github.com/friendica/friendica
synced 2025-04-22 08:30:10 +00:00
Issue 12345: No link preview on DFRN posts
This commit is contained in:
parent
b9cb94c432
commit
7d51fa47d5
6 changed files with 72 additions and 26 deletions
|
@ -734,6 +734,9 @@ class Image
|
|||
public function getBlurHash(): string
|
||||
{
|
||||
$image = New Image($this->asString());
|
||||
if (empty($image)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$width = $image->getWidth();
|
||||
$height = $image->getHeight();
|
||||
|
@ -749,7 +752,11 @@ class Image
|
|||
$row = [];
|
||||
for ($x = 0; $x < $width; ++$x) {
|
||||
if ($image->isImagick()) {
|
||||
$colors = $image->image->getImagePixelColor($x, $y)->getColor();
|
||||
try {
|
||||
$colors = $image->image->getImagePixelColor($x, $y)->getColor();
|
||||
} catch (\Throwable $th) {
|
||||
return '';
|
||||
}
|
||||
$row[] = [$colors['r'], $colors['g'], $colors['b']];
|
||||
} else {
|
||||
$index = imagecolorat($image->image, $x, $y);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue