Revision 02faa087
Added by Andreas Kohlbecker over 6 years ago
modules/cdm_dataportal/includes/pages.inc | ||
---|---|---|
681 | 681 |
|
682 | 682 |
$representationPart = new stdClass(); |
683 | 683 |
$attributes = array(); |
684 |
if (isset($media[0]->representations[0]->parts[0])) { |
|
685 |
$representationPart = $media[0]->representations[0]->parts[0]; |
|
686 |
$attributes['alt'] = $representationPart->uri; |
|
687 |
|
|
688 |
if (!empty($taxon_profile_image_settings['media_uri_query'])) { |
|
689 |
$representationPart->uri = $representationPart->uri |
|
690 |
. (strpos($representationPart->uri, '?') !== FALSE ? '&' : '?') |
|
691 |
. $taxon_profile_image_settings['media_uri_query']; |
|
684 |
if (isset($media[0])) { |
|
685 |
// due to a bug the portal/taxon/{uuid}/media service only delivers a filtered media object |
|
686 |
// which only contains the thumbnail representation even if the height and width filters are not set. |
|
687 |
// --> #6970 |
|
688 |
$preferred_media = cdm_ws_get(CDM_WS_MEDIA, $media[0]->uuid); |
|
689 |
$preferred_representations = cdm_preferred_media_representations($preferred_media, array( |
|
690 |
'image/jpg', |
|
691 |
'image/jpeg', |
|
692 |
'image/png', |
|
693 |
'image/gif', |
|
694 |
), |
|
695 |
$taxon_profile_image_settings['maxextend'], |
|
696 |
$taxon_profile_image_settings['maxextend'] |
|
697 |
); |
|
698 |
if(count($preferred_representations) > 0){ |
|
699 |
|
|
700 |
$representation = array_shift($preferred_representations); |
|
701 |
$representationPart = $representation->parts[0]; |
|
702 |
$attributes['alt'] = $representationPart->uri; |
|
703 |
|
|
704 |
if (!empty($taxon_profile_image_settings['media_uri_query'])) { |
|
705 |
$representationPart->uri = $representationPart->uri |
|
706 |
. (strpos($representationPart->uri, '?') !== FALSE ? '&' : '?') |
|
707 |
. $taxon_profile_image_settings['media_uri_query']; |
|
708 |
} |
|
692 | 709 |
} |
693 | 710 |
} |
694 | 711 |
else { |
Also available in: Unified diff
fix #6969 using the size defined in settings to use the preferred representation