Merge pull request #2443 from annando/1604-fbrowser
fbrowser: Take the picture as that mostly fits
This commit is contained in:
commit
df62bcab2e
1 changed files with 3 additions and 3 deletions
|
@ -74,9 +74,9 @@ function fbrowser_content($a){
|
||||||
$filename_e = $rr['filename'];
|
$filename_e = $rr['filename'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Take the second largest picture as preview
|
// Take the largest picture that is smaller or equal 640 pixels
|
||||||
$p = q("SELECT `scale` FROM `photo` WHERE `resource-id` = '%s' AND `scale` > %d ORDER BY `resource-id`, `scale` LIMIT 1",
|
$p = q("SELECT `scale` FROM `photo` WHERE `resource-id` = '%s' AND `height` <= 640 AND `width` <= 640 ORDER BY `resource-id`, `scale` LIMIT 1",
|
||||||
dbesc($rr['resource-id']), intval($rr['hiq']));
|
dbesc($rr['resource-id']));
|
||||||
if ($p)
|
if ($p)
|
||||||
$scale = $p[0]["scale"];
|
$scale = $p[0]["scale"];
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue