X-Git-Url: http://git.cyclocoop.org/ecrire?a=blobdiff_plain;f=includes%2Fgallery%2FTraditionalImageGallery.php;h=d2f741735166a72052d81bfa346e32f426f7c107;hb=5311afb6a4e37d92878a06edc8b15494b3897a37;hp=181c7b8e08d612dade62bad3e333bd9e4e6c9f80;hpb=42e257a1a28c3b381eb1f6002e4b6417fc85d8a4;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/gallery/TraditionalImageGallery.php b/includes/gallery/TraditionalImageGallery.php
index 181c7b8e08..d2f7417351 100644
--- a/includes/gallery/TraditionalImageGallery.php
+++ b/includes/gallery/TraditionalImageGallery.php
@@ -111,48 +111,51 @@ class TraditionalImageGallery extends ImageGalleryBase {
htmlspecialchars( $nt->getText() )
) .
'';
- } elseif ( !( $thumb = $img->transform( $transformOptions ) ) ) {
- # Error generating thumbnail.
- $thumbhtml = "\n\t\t\t" . '
'
- . htmlspecialchars( $img->getLastError() ) . '
';
} else {
- /** @var MediaTransformOutput $thumb */
- $vpad = $this->getVPad( $this->mHeights, $thumb->getHeight() );
-
- $imageParameters = array(
- 'desc-link' => true,
- 'desc-query' => $descQuery,
- 'alt' => $alt,
- 'custom-url-link' => $link
- );
-
- // In the absence of both alt text and caption, fall back on
- // providing screen readers with the filename as alt text
- if ( $alt == '' && $text == '' ) {
- $imageParameters['alt'] = $nt->getText();
- }
-
- $this->adjustImageParameters( $thumb, $imageParameters );
-
- Linker::processResponsiveImages( $img, $thumb, $transformOptions );
-
- # Set both fixed width and min-height.
- $thumbhtml = "\n\t\t\t"
- . ''
- # Auto-margin centering for block-level elements. Needed
- # now that we have video handlers since they may emit block-
- # level elements as opposed to simple
tags. ref
- # http://css-discuss.incutio.com/?page=CenteringBlockElement
- . '
'
- . $thumb->toHtml( $imageParameters ) . '
';
-
- // Call parser transform hook
- /** @var MediaHandler $handler */
- $handler = $img->getHandler();
- if ( $this->mParser && $handler ) {
- $handler->parserTransformHook( $this->mParser, $img );
+ $thumb = $img->transform( $transformOptions );
+ if ( !$thumb ) {
+ # Error generating thumbnail.
+ $thumbhtml = "\n\t\t\t" . ''
+ . htmlspecialchars( $img->getLastError() ) . '
';
+ } else {
+ /** @var MediaTransformOutput $thumb */
+ $vpad = $this->getVPad( $this->mHeights, $thumb->getHeight() );
+
+ $imageParameters = array(
+ 'desc-link' => true,
+ 'desc-query' => $descQuery,
+ 'alt' => $alt,
+ 'custom-url-link' => $link
+ );
+
+ // In the absence of both alt text and caption, fall back on
+ // providing screen readers with the filename as alt text
+ if ( $alt == '' && $text == '' ) {
+ $imageParameters['alt'] = $nt->getText();
+ }
+
+ $this->adjustImageParameters( $thumb, $imageParameters );
+
+ Linker::processResponsiveImages( $img, $thumb, $transformOptions );
+
+ # Set both fixed width and min-height.
+ $thumbhtml = "\n\t\t\t"
+ . ''
+ # Auto-margin centering for block-level elements. Needed
+ # now that we have video handlers since they may emit block-
+ # level elements as opposed to simple
tags. ref
+ # http://css-discuss.incutio.com/?page=CenteringBlockElement
+ . '
'
+ . $thumb->toHtml( $imageParameters ) . '
';
+
+ // Call parser transform hook
+ /** @var MediaHandler $handler */
+ $handler = $img->getHandler();
+ if ( $this->mParser && $handler ) {
+ $handler->parserTransformHook( $this->mParser, $img );
+ }
}
}