mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-04-19 21:09:36 +00:00
Compare commits
No commits in common. "23cd51c1caaa7cc6a61aac7f81d85f41aba2b3f8" and "8b417d6441cf4f5e8bf414af7d243a049c81c727" have entirely different histories.
23cd51c1ca
...
8b417d6441
3 changed files with 1026 additions and 1372 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 or is invalid
|
* @return string|null The URL or null if the attachment file is not existing
|
||||||
*/
|
*/
|
||||||
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()) {
|
||||||
return null;
|
throw new InvalidArgumentException('Thumbnail creation only works for picture attachments!');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$attachment->hasInternal()){
|
if (!$attachment->hasInternal()){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue