You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Images larger than assets.thumbnails.max_width won't generate thumbnails, which is fine, but to non-technical editors that don't know this limitation, it looks like the image is broken or there was an error uploading it. The thumbnail url resolves to a 404 and will prompt the browser to show an icon for broken/missing images.
Example
Suggested solution
I'd suggest showing a generic "image" icon instead of linking to the thumbnail here, similar to how non-image assets are displayed, e.g. PDFs that have their own icon.
Looking at the source, there is some logic for showing a placeholder instead of the thumbnail.
class ThumbnailController extends Controller
{
/** * If an image is deemed too large for thumbnail generation, we'll give it a placeholder icon. */privatefunctiongetPlaceholderResponse()
{
$maxWidth = Config::get('statamic.assets.thumbnails.max_width');
$maxHeight = Config::get('statamic.assets.thumbnails.max_height');
if ($this->asset->width() < $maxWidth && $this->asset->height() < $maxHeight) {
return;
}
returnredirect(Statamic::cpAssetUrl('svg/filetypes/picture.svg'));
}
}
The logic is working correctly, redirecting to the placeholder SVG. However it looks like those SVGs at vendor/statamic/svg/filetypes/* are currently not copied into the final build folder. They're probably all dynamic JS imports these days.
Bug description
Images larger than
assets.thumbnails.max_width
won't generate thumbnails, which is fine, but to non-technical editors that don't know this limitation, it looks like the image is broken or there was an error uploading it. The thumbnail url resolves to a 404 and will prompt the browser to show an icon for broken/missing images.Example
Suggested solution
I'd suggest showing a generic "image" icon instead of linking to the thumbnail here, similar to how non-image assets are displayed, e.g. PDFs that have their own icon.
How to reproduce
Upload than image larger than 10.000 x 10.000px
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: