Add double-density support to photo thumbnails #28

Merged
Aaron merged 13 commits from improve_thumbs into master 2022-11-27 14:38:22 +01:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit c763967463 - Show all commits

View File

@ -43,7 +43,7 @@ class GenericTable
$this->start = empty($options['start']) || !is_numeric($options['start']) || $options['start'] < 0 || $options['start'] > $this->recordCount ? 0 : $options['start']; $this->start = empty($options['start']) || !is_numeric($options['start']) || $options['start'] < 0 || $options['start'] > $this->recordCount ? 0 : $options['start'];
// Figure out where we are on the whole, too. // Figure out where we are on the whole, too.
$numPages = ceil($this->recordCount / $this->items_per_page); $numPages = max(1, ceil($this->recordCount / $this->items_per_page));
$this->currentPage = min(ceil($this->start / $this->items_per_page) + 1, $numPages); $this->currentPage = min(ceil($this->start / $this->items_per_page) + 1, $numPages);
// Let's bear a few things in mind... // Let's bear a few things in mind...

View File

@ -63,9 +63,9 @@ class PageIndex
lower current/cont. pgs. center upper lower current/cont. pgs. center upper
*/ */
$this->num_pages = ceil($this->recordCount / $this->items_per_page); $this->num_pages = max(1, ceil($this->recordCount / $this->items_per_page));
$this->current_page = min(ceil($this->start / $this->items_per_page) + 1, $this->num_pages); $this->current_page = min(ceil($this->start / $this->items_per_page) + 1, $this->num_pages);
if ($this->num_pages == 0) if ($this->num_pages <= 1)
{ {
$this->needsPageIndex = false; $this->needsPageIndex = false;
return; return;