- }
- else {
- $vpad = floor( ( 150 - $thumb->height ) /2 ) - 2;
- $thumbhtml = '<div class="thumb" style="padding: ' . $vpad . 'px 0;">'
- . $sk->makeKnownLinkObj( $nt, $thumb->toHtml() ) . '</div>';
+ } else {
+ $vpad = floor( ( 1.25*$this->mHeights - $thumb->height ) /2 ) - 2;
+
+ $thumbhtml = "\n\t\t\t".
+ '<div class="thumb" style="padding: ' . $vpad . 'px 0; width: ' .($this->mWidths+30).'px;">'
+ # 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 <img> tags.
+ # ref http://css-discuss.incutio.com/?page=CenteringBlockElement
+ . '<div style="margin-left: auto; margin-right: auto; width: ' .$this->mWidths.'px;">'
+ . $thumb->toHtml( array( 'desc-link' => true, 'desc-query' => $descQuery ) ) . '</div></div>';
+
+ // Call parser transform hook
+ if ( $this->mParser && $img->getHandler() ) {
+ $img->getHandler()->parserTransformHook( $this->mParser, $img );
+ }