Add double-density support to photo thumbnails #28

Sloučený
Aaron sloučil 13 commity z větve improve_thumbs do větve master před 2022-11-27 14:38:22 +01:00
2 změnil soubory, kde provedl 10 přidání a 6 odebrání
Zobrazuji pouze změny commitu 6369187eb7 - Zobrazit všechny commity

Zobrazit soubor

@ -65,11 +65,9 @@ class PhotoPage extends SubTemplate
<a href="', $this->photo->getUrl(), '">';
if ($this->photo->isPortrait())
echo '
<img src="', $this->photo->getThumbnailUrl(null, 960), '" alt="">';
echo $this->photo->getInlineImage(null, 960);
else
echo '
<img src="', $this->photo->getThumbnailUrl(1280, null), '" alt="">';
echo $this->photo->getInlineImage(1280, null);
echo '
</a>

Zobrazit soubor

@ -90,8 +90,14 @@ class PhotosIndex extends SubTemplate
<a class="edit" href="', BASEURL, '/editasset/?id=', $image->getId(), '">Edit</a>';
echo '
<a href="', $image->getPageUrl(), $this->url_suffix, '">
<img src="', $image->getThumbnailUrl($width, $height, $crop, $fit), '" alt="" title="', $image->getTitle(), '">';
<a href="', $image->getPageUrl(), $this->url_suffix, '#photo_frame">
<img src="', $image->getThumbnailUrl($width, $height, $crop, $fit), '"';
// Can we offer double-density thumbs?
if ($image->width() >= $width * 2 && $image->height() >= $height * 2)
echo ' srcset="', $image->getThumbnailUrl($width * 2, $height * 2, $crop, $fit), ' 2x"';
echo ' alt="" title="', $image->getTitle(), '">';
if ($this->show_labels)
echo '