From 9925e1562b3603d704bd6b5bf5b4320fa4ba24fd Mon Sep 17 00:00:00 2001 From: Christian Fritsch Date: Thu, 3 May 2018 14:50:47 +0200 Subject: [PATCH] Use HighRes image --- src/JsonClient.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/JsonClient.php b/src/JsonClient.php index 4cdc1e6..c80fbd3 100644 --- a/src/JsonClient.php +++ b/src/JsonClient.php @@ -195,11 +195,22 @@ protected function buildImageAsset(array $json) { * processing. The callback method called like like this: * call_user_func($callback, $json, $arguments) */ + + $variant_types = $this->processAttributeMap([ + 'variants' => [ + '_files_index', + 'variant_type', + 'master', + ], + ], $json); + + $hires_image = $variant_types['variants']['minihires']; + $attribute_map = [ 'id' => ['_id'], 'filename' => ['fields', 'Filename', 0, 'value'], 'title' => ['fields', 'Filename', 0, 'value'], - 'url' => [[$this, 'extractUrl'], 'files', 0, '_id'], + 'url' => [[$this, 'extractUrl'], 'files', $hires_image, '_id'], 'source' => [[$this, 'joinValues'], 'fields', 'Creator'], 'copyright' => ['fields', 'CopyrightNotice', 0, 'value'], 'status' => [[$this, 'computeStatus']],