I'd like to have some control of the display size of an image, even if the actual size is restricted to the few options available from flickr's api.

The attached patch will change flickr.inc so that it won't override the img tag's width and height parameters with the selected flickr api size.

Then with something like this in the template.php you can have more control over the display sizes:

function themename_flickr_photo($p, $size = NULL, $format = NULL, $attribs = NULL) {
  $attribs = array('width' => '180px', 'height' => '180px'); /* CONTROL DISPLAY SIZES HERE */
  $img = flickr_img($p, $size, $attribs);
  $photo_url = flickr_photo_page_url($p['owner'], $p['id']);
  $title = is_array($p['title']) ? $p['title']['_content'] : $p['title'];
  return l($img, $photo_url, array('attributes' => array('title' => $title), 'absolute' => TRUE, 'html' => TRUE));
}
CommentFileSizeAuthor
flickr.inc_.patch728 bytesdrasgardian

Comments

lolandese’s picture

Status: Active » Closed (won't fix)

Sorry for the late reply.

As understood from the issue summary, you suggest to hard code image sizes in the code. This would only be an option for those able to tweak. Please, correct me if I'm wrong.

Flickr recently added many new sizes, most interesting a Large Square (150px) and Small 320 (320px on longest side). There is now an acceptable range of sizes available in the latest D7 dev version of the module.

Thanks.