Add optional images to slides
Slides (except YouTube) can carry one image. Uploads are validated, rotated by EXIF orientation, scaled to 1600 px and stored as WebP outside webroot, which also strips camera metadata. Images have an alt text (or are marked decorative) and a layout: top, side or full screen (content slides). Files are removed after the commit when a slide is deleted or its image is replaced, with the poll, and `bin/cake images_cleanup` sweeps leftovers. Duplicated slides get their own file. Docker image gains gd with WebP. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c7818ee40
commit
a395b50894
30 files changed
+1705
-11
No files matched your search
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* The image of a slide on the participant's page (always above the content, whatever the stage layout).
|
||||
* Width and height reserve the space, so the page does not jump while the image loads.
|
||||
*
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Slide $slide
|
||||
* @var \App\Model\Entity\Poll $poll
|
||||
*/
|
||||
if (!$slide->hasImage()) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<figure class="slide-image">
|
||||
<img src="<?= h($this->Url->build(['_name' => 'participate:image', 'code' => $poll->join_code, 'file' => $slide->image])) ?>"
|
||||
alt="<?= h((string)$slide->image_alt) ?>"
|
||||
<?= $slide->image_width && $slide->image_height ? 'width="' . (int)$slide->image_width . '" height="' . (int)$slide->image_height . '"' : '' ?>
|
||||
decoding="async">
|
||||
</figure>
|
||||
Reference in new issue
Block a user