mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 19:34:31 +02:00
Show higher resolution thumbnail when hover over a table picture.
Also use thumbnails for attachment edit preview.
This commit is contained in:
parent
a545e04554
commit
4c7767feed
9 changed files with 35 additions and 12 deletions
|
@ -139,8 +139,14 @@ class AttachmentURLGenerator
|
|||
return $this->urlGenerator->generate('attachment_view', ['id' => $attachment->getID()]);
|
||||
}
|
||||
|
||||
//For builtin ressources it is not useful to create a thumbnail
|
||||
//because the footprints images are small and highly optimized already.
|
||||
if ($filter_name === 'thumbnail_md' && $attachment->isBuiltIn()) {
|
||||
return $this->assets->getUrl($asset_path);
|
||||
}
|
||||
|
||||
//Otherwise we can serve the relative path via Asset component
|
||||
return $this->filterService->getUrlOfFilteredImage($asset_path, 'thumbnail_sm');
|
||||
return $this->filterService->getUrlOfFilteredImage($asset_path, $filter_name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -151,6 +157,6 @@ class AttachmentURLGenerator
|
|||
public function getDownloadURL(Attachment $attachment) : string
|
||||
{
|
||||
//Redirect always to download controller, which sets the correct headers for downloading:
|
||||
$this->urlGenerator->generate('attachment_download', ['id' => $attachment->getID()]);
|
||||
return $this->urlGenerator->generate('attachment_download', ['id' => $attachment->getID()]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue