You are here

function _emimage_picasa_guess_size in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 contrib/emimage/providers/picasa.inc \_emimage_picasa_guess_size()
1 call to _emimage_picasa_guess_size()
emimage_picasa_image_url in contrib/emimage/providers/picasa.inc
Implement emimage_PROVIDER_image_url.

File

contrib/emimage/providers/picasa.inc, line 182
This include processes picasa.com image files for use by emfield.module.

Code

function _emimage_picasa_guess_size($width, $height) {
  $max = max($width, $height);
  foreach (array(
    '144' => 144,
    '288' => 288,
    '400' => 400,
    '800' => 800,
  ) as $size => $value) {
    if ($max <= $value) {
      return $size;
    }
  }

  // we would use the original size if we could, but we can't since google won't serve it
  return '800';
}