Improved image and attachment viewing on part info page

This commit is contained in:
Jan Böhmer 2023-07-23 01:32:28 +02:00
parent 1de1eebc59
commit fc7e436ca9
3 changed files with 12 additions and 3 deletions

View file

@ -58,6 +58,14 @@ class PartPreviewGenerator
$list[] = $attachment;
}
//Then comes the other images of the part
foreach ($part->getAttachments() as $attachment) {
//Dont show the master attachment twice
if ($this->isAttachmentValidPicture($attachment) && $attachment !== $part->getMasterPictureAttachment()) {
$list[] = $attachment;
}
}
if ($part->getFootprint() instanceof Footprint) {
$attachment = $part->getFootprint()->getMasterPictureAttachment();
if ($this->isAttachmentValidPicture($attachment)) {