$statement = $this->database->prepareStatement($sql, $limit, $offset);
$statement->execute([0, 0]);
while ($row = $statement->fetchArray()) {
- $fileLocation = $this->getAttachmentFilename($row['id_attach'], $row['id_folder'], $row['file_hash']);
+ if (substr($row['filename'], -6) == '_thumb') {
+ continue; // ignore thumbnails
+ }
+
+ $fileLocation = $this->getAttachmentFilename($row['id_attach'], $row['id_folder'], $row['file_hash'], $row['filename']);
if ($imageSize = @getimagesize($fileLocation)) {
$row['isImage'] = 1;