Contribution Date
Technology
Contribution Project
Contribution Details
The patch in #2 is identical to the patch in #3005252-2: Add support of 1600 image size limit. Only difference is:
diff --git a/src/Plugin/media/Source/AcquiadamAsset.php b/src/Plugin/media/Source/AcquiadamAsset.php
index b3483e2..cbafd58 100644
--- a/src/Plugin/media/Source/AcquiadamAsset.php
+++ b/src/Plugin/media/Source/AcquiadamAsset.php
@@ -687,6 +687,7 @@ class AcquiadamAsset extends MediaSourceBase {
$biggest_matching = $thumbnails[0]->url;
foreach ($thumbnails as $tn) {
if (!empty($tn->url) && $thumbnail_size >= $tn->size) {
+ $biggest_matching = $tn->url;
// Certain types do not have a 1280 size available despite returning
// an URL. We either have to hard code mime types as they crop up, or
// check if the URL is accessible on our own. Other URL sizes do not
@@ -694,10 +695,11 @@ class AcquiadamAsset extends MediaSourceBase {
if (1280 == $tn->size) {
$response = \Drupal::httpClient()->head($tn->url);
if (403 == $response->getStatusCode()) {
- continue;
+ // Try another API to generate thumbnail URL if the default one
+ // fails.
+ $biggest_matching = $this->generateThumbnailUrlBySize($asset, $thumbnail_size);
}
}
- $biggest_matching = $tn->url;
}
}
return $biggest_matching;
Issue Status
Needs Review
Contribution Issue Link
Files count
0
Patches count
0