You are here

function customResolutionUrl in Bynder 7

1 call to customResolutionUrl()
bynder_embed_url in includes/bynder.utils.inc
Create the embed url for a fragment.

File

includes/bynder.utils.inc, line 174
utility functions for the bynder module

Code

function customResolutionUrl($idHash, $effect) {
  $bynder_url = variable_get('bynder_cdn_url', false);
  if (!$bynder_url) {
    $bynder_url = variable_get('bynder_url', '');
  }
  $url = $bynder_url . '/images/media/' . $idHash . '/derivatives/' . variable_get('bynder_custom_derivative') . '?w=' . $effect['data']['width'] . '&h=' . $effect['data']['height'];
  $effectName = str_replace('bynder_custom_resolution_', '', $effect['name']);
  switch ($effectName) {
    case 'crop':
    case 'extent':
      $url .= '&' . $effectName . '=1';
      break;
  }
  return validateBynderDrupalUrl($url);
}