mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-04-18 12:29:36 +00:00
Compare commits
2 commits
8b417d6441
...
23cd51c1ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23cd51c1ca | ||
|
|
d370f976a7 |
3 changed files with 1372 additions and 1026 deletions
1387
composer.lock
generated
1387
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -112,12 +112,12 @@ class AttachmentURLGenerator
|
||||||
/**
|
/**
|
||||||
* Returns a URL to a thumbnail of the attachment file.
|
* Returns a URL to a thumbnail of the attachment file.
|
||||||
* For external files the original URL is returned.
|
* For external files the original URL is returned.
|
||||||
* @return string|null The URL or null if the attachment file is not existing
|
* @return string|null The URL or null if the attachment file is not existing or is invalid
|
||||||
*/
|
*/
|
||||||
public function getThumbnailURL(Attachment $attachment, string $filter_name = 'thumbnail_sm'): ?string
|
public function getThumbnailURL(Attachment $attachment, string $filter_name = 'thumbnail_sm'): ?string
|
||||||
{
|
{
|
||||||
if (!$attachment->isPicture()) {
|
if (!$attachment->isPicture()) {
|
||||||
throw new InvalidArgumentException('Thumbnail creation only works for picture attachments!');
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$attachment->hasInternal()){
|
if (!$attachment->hasInternal()){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue