Skip to content

Commit

Permalink
cast fixed thumb creation for the fourth time .. i hope for good now
Browse files Browse the repository at this point in the history
  • Loading branch information
“duck7000” committed Oct 8, 2023
1 parent dd7c0a4 commit edc56d3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Imdb/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -913,15 +913,13 @@ public function cast()
$fullImageHeight = $edge->node->name->primaryImage->height;
// calculate crop value
$cropParameter = $this->thumbUrlCropParameter($fullImageWidth, $fullImageHeight, 32, 44);
$ratio = $fullImageWidth / $fullImageHeight;
if ($ratio >= 0.9) {
// Landscape (Y)
$orientation = 'SY44';
} else {
// portrait (X)
$img = str_replace('.jpg', '', $edge->node->name->primaryImage->url);
$asFactor = $fullImageWidth / $fullImageHeight;
if ($asFactor <= 0.7) {
$orientation = 'SX32';
} else {
$orientation = 'SY44';
}
$img = str_replace('.jpg', '', $edge->node->name->primaryImage->url);
$imgUrl = $img . 'QL100_' . $orientation . '_CR' . $cropParameter . ',0,32,44_AL_.jpg';
}

Expand Down

0 comments on commit edc56d3

Please sign in to comment.