lonepress
Chevereto Member
For images in S3, image_album_slice.php fails to show the thumbnails of images in the album.
The problem is that the DB query in getAlbumSlice doesn't join on the storages table, so Image::getSrcTargetSingle thinks it is operating on a local path rather than a URL.
I was able to fix it by adding the join in the DB query, in Image::getAlbumSlice:
The problem is that the DB query in getAlbumSlice doesn't join on the storages table, so Image::getSrcTargetSingle thinks it is operating on a local path rather than a URL.
I was able to fix it by adding the join in the DB query, in Image::getAlbumSlice:
PHP:
$db->query('SELECT * FROM (
(SELECT * FROM '.$tables['images'].' LEFT JOIN '.$tables['storages'].' ON '.$tables['images'].'.image_storage_id = '.$tables['storages'].'.storage_id
WHERE image_album_id=:image_album_id AND image_id <= :image_id ORDER BY image_id DESC LIMIT 0,'.($padding*2 + 1).')
UNION
(SELECT * FROM '.$tables['images'].' LEFT JOIN '.$tables['storages'].' ON '.$tables['images'].'.image_storage_id = '.$tables['storages'].'.storage_id
WHERE image_album_id=:image_album_id AND image_id > :image_id ORDER BY image_id ASC LIMIT 0,'.($padding*2).')
) images ORDER BY images.image_id ASC');
Last edited by a moderator: