Closed (won't fix)
Project:
Flickr
Version:
6.x-1.x-dev
Component:
flickr (main module)
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2010 at 22:08 UTC
Updated:
22 Feb 2013 at 12:23 UTC
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));
}
| Comment | File | Size | Author |
|---|---|---|---|
| flickr.inc_.patch | 728 bytes | drasgardian |
Comments
Comment #1
lolandese commentedSorry 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.