fbrowser: Take the picture as that mostly fits

pull/3010/head
Michael Vogel 2016-04-10 13:36:26 +02:00 zatwierdzone przez Roland Haeder
rodzic a201d5b9cc
commit 94bf0e2ad8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B72F8185C6C7BD78
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -74,9 +74,9 @@ function fbrowser_content($a){
$filename_e = $rr['filename'];
}
// Take the second largest picture as preview
$p = q("SELECT `scale` FROM `photo` WHERE `resource-id` = '%s' AND `scale` > %d ORDER BY `resource-id`, `scale` LIMIT 1",
dbesc($rr['resource-id']), intval($rr['hiq']));
// Take the largest picture that is smaller or equal 640 pixels
$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']));
if ($p)
$scale = $p[0]["scale"];
else