r95602 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95601‎ | r95602 | r95603 >
Date:17:40, 27 August 2011
Author:johnduhart
Status:reverted (Comments)
Tags:
Comment:
(bug 17791) ProofreadPage broken for GIF images due to assuming it can always create thumbnails. Patch by Beau
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage_body.php (modified) (history)
  • /trunk/extensions/ProofreadPage/proofread.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php
@@ -75,7 +75,7 @@
7676
7777 /**
7878 * Set up our custom parser hooks when initializing parser.
79 - *
 79+ *
8080 * @param Parser $parser
8181 * @return boolean hook return value
8282 */
@@ -324,7 +324,7 @@
325325 return true;
326326 }
327327
328 - if ( $isEdit && ( preg_match( "/^$index_namespace:(.*?)(\/([0-9]*)|)$/", $out->getTitle()->getPrefixedText(), $m ) ) ) {
 328+ if ( $isEdit && $out->getTitle()->getNamespace() == self::getIndexNamespaceId() ) {
329329 self::prepareIndex( $out );
330330 return true;
331331 }
@@ -339,10 +339,13 @@
340340
341341 private static function prepareIndex( $out ) {
342342 $out->addModules( 'ext.proofreadpage.index' );
343 - $out->addInlineScript("
344 -var prp_index_attributes = \"" . Xml::escapeJsString( wfMsgForContent( 'proofreadpage_index_attributes' ) ) . "\";
345 -var prp_default_header = \"" . Xml::escapeJsString( wfMsgForContentNoTrans( 'proofreadpage_default_header' ) ) . "\";
346 -var prp_default_footer = \"" . Xml::escapeJsString( wfMsgForContentNoTrans( 'proofreadpage_default_footer' ) ) . "\";" );
 343+
 344+ $jsVars = array(
 345+ 'prp_index_attributes' => wfMsgForContent( 'proofreadpage_index_attributes' ),
 346+ 'prp_default_header' => wfMsgForContentNoTrans( 'proofreadpage_default_header' ),
 347+ 'prp_default_footer' => wfMsgForContentNoTrans( 'proofreadpage_default_footer' ),
 348+ );
 349+ $out->addInlineScript( ResourceLoader::makeConfigSetScript( $jsVars ) );
347350 }
348351
349352 private static function preparePage( $out, $m, $isEdit ) {
@@ -357,31 +360,32 @@
358361 return true;
359362 }
360363
 364+ $fileName = null;
 365+ $filePage = null;
 366+ $fileWidth = 0;
 367+ $fileHeight = 0;
 368+ $fileFullUrl = null;
 369+ $scanLink = null;
 370+
361371 $image = wfFindFile( $imageTitle );
 372+
362373 if ( $image && $image->exists() ) {
363 - $width = $image->getWidth();
364 - $height = $image->getHeight();
 374+ $fileName = $imageTitle->getPrefixedText();
 375+ $fileWidth = $image->getWidth();
 376+ $fileHeight = $image->getHeight();
 377+
365378 if ( $m[2] ) {
366 - $thumbName = $image->thumbName( array( 'width' => '##WIDTH##', 'page' => $m[3] ) );
367 - $thumbURL = $image->getThumbUrl( $thumbName );
368 - $thumbURL = str_replace( '%23', '#', $thumbURL );
369 - $fullURL = str_replace( '##WIDTH##', "$width", $thumbURL );
 379+ $filePage = $m[3];
 380+
 381+ $thumbName = $image->thumbName( array( 'width' => $fileWidth, 'page' => $filePage ) );
 382+ $fileFullUrl = $image->getThumbUrl( $thumbName );
370383 } else {
371 - $thumbName = $image->thumbName( array( 'width' => '##WIDTH##' ) );
372 - $thumbURL = $image->getThumbUrl( $thumbName );
373 - $thumbURL = str_replace( '%23', '#', $thumbURL );
374 - $fullURL = $image->getURL();
 384+ $fileFullUrl = $image->getViewURL();
375385 }
376 - $scan_link = Html::element( 'a',
377 - array( 'href' => $fullURL,
378 - 'title' => wfMsg( 'proofreadpage_image' ) ),
 386+ $scanLink = Html::element( 'a',
 387+ array( 'href' => $fileFullUrl,
 388+ 'title' => wfMsg( 'proofreadpage_image' ) ),
379389 wfMsg( 'proofreadpage_image' ) );
380 - } else {
381 - $width = 0;
382 - $height = 0;
383 - $thumbURL = '';
384 - $fullURL = '';
385 - $scan_link = '';
386390 }
387391
388392 list( $index_title, $prev_title, $next_title, $header, $footer, $css, $edit_width ) = self::navigation( $out->getTitle() );
@@ -389,32 +393,33 @@
390394 $sk = $wgUser->getSkin();
391395 $path = $wgExtensionAssetsPath . '/ProofreadPage';
392396
393 - $next_link = $next_title ? $sk->link( $next_title,
 397+ $nextLink = $next_title ? $sk->link( $next_title,
394398 Html::element( 'img', array( 'src' => $path . '/rightarrow.png',
395399 'alt' => wfMsg( 'proofreadpage_nextpage' ), 'width' => 15, 'height' => 15 ) ),
396 - array( 'title' => wfMsg( 'proofreadpage_nextpage' ) ) ) : '';
 400+ array( 'title' => wfMsg( 'proofreadpage_nextpage' ) ) ) : null;
397401
398 - $prev_link = $prev_title ? $sk->link( $prev_title,
399 - Html::element( 'img', array( 'src' => $path . '/leftarrow.png',
400 - 'alt' => wfMsg( 'proofreadpage_prevpage' ), 'width' => 15, 'height' => 15 ) ),
401 - array( 'title' => wfMsg( 'proofreadpage_prevpage' ) ) ): '';
 402+ $prevLink = $prev_title ? $sk->link( $prev_title,
 403+ Html::element( 'img', array( 'src' => $path . '/leftarrow.png',
 404+ 'alt' => wfMsg( 'proofreadpage_prevpage' ), 'width' => 15, 'height' => 15 ) ),
 405+ array( 'title' => wfMsg( 'proofreadpage_prevpage' ) ) ): null;
402406
403 - $index_link = $index_title ? $sk->link( $index_title,
404 - Html::element( 'img', array( 'src' => $path . '/uparrow.png',
 407+ $indexLink = $index_title ? $sk->link( $index_title,
 408+ Html::element( 'img', array( 'src' => $path . '/uparrow.png',
405409 'alt' => wfMsg( 'proofreadpage_index' ), 'width' => 15, 'height' => 15 ) ),
406 - array( 'title' => wfMsg( 'proofreadpage_index' ) ) ) : '';
 410+ array( 'title' => wfMsg( 'proofreadpage_index' ) ) ) : null;
407411
408412 $jsVars = array(
409 - 'proofreadPageWidth' => intval( $width ),
410 - 'proofreadPageHeight' => intval( $height ),
 413+ 'proofreadPageWidth' => intval( $fileWidth ),
 414+ 'proofreadPageHeight' => intval( $fileHeight ),
411415 'proofreadPageEditWidth' => $edit_width,
412 - 'proofreadPageThumbURL' => $thumbURL,
413 - 'proofreadPageURL' => $fullURL,
 416+ 'proofreadPageURL' => $fileFullUrl,
 417+ 'proofreadPageFileName' => $fileName,
 418+ 'proofreadPageFilePage' => $filePage,
414419 'proofreadPageIsEdit' => intval( $isEdit ),
415 - 'proofreadPageIndexLink' => $index_link,
416 - 'proofreadPageNextLink' => $next_link,
417 - 'proofreadPagePrevLink' => $prev_link,
418 - 'proofreadPageScanLink' => $scan_link,
 420+ 'proofreadPageIndexLink' => $indexLink,
 421+ 'proofreadPageNextLink' => $nextLink,
 422+ 'proofreadPagePrevLink' => $prevLink,
 423+ 'proofreadPageScanLink' => $scanLink,
419424 'proofreadPageHeader' => $header,
420425 'proofreadPageFooter' => $footer,
421426 'proofreadPageAddButtons' => $wgUser->isAllowed( 'pagequality' ),
@@ -852,7 +857,7 @@
853858 null,
854859 array( 'categorylinks' => array( 'LEFT JOIN', 'cl_from=page_id' ) )
855860 );
856 -
 861+
857862 if( $res ) {
858863 foreach ( $res as $o ) {
859864 array_push( $q0_pages, $o->page_title );
@@ -1544,7 +1549,7 @@
15451550 if( $indextitle ) {
15461551 $sk = $wgUser->getSkin();
15471552 $nt = Title::makeTitleSafe( $index_ns_index, $indextitle );
1548 - $indexlink = $sk->link( $nt, wfMsg( 'proofreadpage_source' ),
 1553+ $indexlink = $sk->link( $nt, wfMsg( 'proofreadpage_source' ),
15491554 array( 'title' => wfMsg( 'proofreadpage_source_message' ) ) );
15501555 $out->addInlineScript( ResourceLoader::makeConfigSetScript( array( 'proofreadpage_source_href' => $indexlink ) ) );
15511556 $out->addModules( 'ext.proofreadpage.article' );
Index: trunk/extensions/ProofreadPage/proofread.js
@@ -1,30 +1,70 @@
22 // Author : ThomasV - License : GPL
33
44 function pr_init_tabs() {
5 - $( '#ca-talk' ).prev().before( '<li id="ca-prev"><span>' + self.proofreadPagePrevLink + '</span></li>' );
6 - $( '#ca-talk' ).prev().before( '<li id="ca-next"><span>' + self.proofreadPageNextLink + '</span></li>' );
7 - $( '#ca-talk' ).after( '<li id="ca-index"><span>' + self.proofreadPageIndexLink + '</span></li>' );
8 - $( '#ca-talk' ).after( '<li id="ca-image"><span>' + self.proofreadPageScanLink + '</span></li>' );
 5+ if( mw.config.get( 'proofreadPagePrevLink' ) != null ) {
 6+ $( '#ca-talk' ).prev().before( '<li id="ca-prev"><span>' + mw.config.get( 'proofreadPagePrevLink' ) + '</span></li>' );
 7+ }
 8+ if( mw.config.get( 'proofreadPageNextLink' ) != null ) {
 9+ $( '#ca-talk' ).prev().before( '<li id="ca-next"><span>' + mw.config.get( 'proofreadPageNextLink' ) + '</span></li>' );
 10+ }
 11+ if( mw.config.get( 'proofreadPageIndexLink' ) != null ) {
 12+ $( '#ca-talk' ).after( '<li id="ca-index"><span>' + mw.config.get( 'proofreadPageIndexLink' ) + '</span></li>' );
 13+ }
 14+ if( mw.config.get( 'proofreadPageScanLink' ) != null ) {
 15+ $( '#ca-talk' ).after( '<li id="ca-image"><span>' + mw.config.get( 'proofreadPageScanLink' ) + '</span></li>' );
 16+ }
917 }
1018
11 -function pr_image_url( requested_width ) {
12 - if( self.proofreadPageExternalURL ) {
13 - self.DisplayWidth = requested_width;
14 - self.DisplayHeight = '';
15 - return self.proofreadPageExternalURL;
 19+function pr_fetch_thumb_url( requestedWidth, callback ) {
 20+ var fullWidth = mw.config.get( 'proofreadPageWidth' );
 21+ var fullHeight = mw.config.get( 'proofreadPageHeight' );
 22+
 23+ // enforce quantization: width must be multiple of 100px
 24+ var quantizedWidth = 100 * Math.round( requestedWidth / 100 );
 25+
 26+ // compare to the width of the image
 27+ if( quantizedWidth < fullWidth ) {
 28+ // Send request to fetch thumbnail url
 29+ var request = {
 30+ action: 'query',
 31+ titles: mw.config.get( 'proofreadPageFileName' ),
 32+ prop: 'imageinfo',
 33+ iiprop: 'url|size',
 34+ iiurlwidth: quantizedWidth,
 35+ format: 'json'
 36+ };
 37+
 38+ if( mw.config.get( 'proofreadPageFilePage' ) != null ) {
 39+ request['iiurlparam'] = 'page' + mw.config.get( 'proofreadPageFilePage' ) + '-' + quantizedWidth + 'px';
 40+ }
 41+
 42+ $.getJSON( mw.util.wikiScript( 'api' ) ,request, function(data) {
 43+ if( data && data.query && data.query.pages ) {
 44+ for( var i in data.query.pages ) {
 45+ var page = data.query.pages[i];
 46+ if( !page.imageinfo || page.imageinfo.length < 1 ) {
 47+ continue;
 48+ }
 49+ var imageinfo = page.imageinfo[0];
 50+
 51+ if( !imageinfo.thumburl ) {
 52+ // Unable to fetch thumbnail, use image without scaling
 53+ // This works only for non-paged files and may mess up the layout of the page
 54+ if ( mw.config.get( 'proofreadPageFilePage' ) == null ) {
 55+ callback( imageinfo.url, imageinfo.width, imageinfo.height );
 56+ }
 57+ }
 58+ else {
 59+ callback( imageinfo.thumburl, imageinfo.thumbwidth, imageinfo.thumbheight );
 60+ }
 61+
 62+ return;
 63+ }
 64+ }
 65+ });
1666 } else {
17 - // enforce quantization: width must be multiple of 100px
18 - var width = 100 * Math.round( requested_width / 100 );
19 - // compare to the width of the image
20 - if( width < proofreadPageWidth ) {
21 - self.DisplayWidth = width;
22 - self.DisplayHeight = width * proofreadPageHeight / proofreadPageWidth;
23 - return proofreadPageThumbURL.replace( '##WIDTH##', '' + width );
24 - } else {
25 - self.DisplayWidth = proofreadPageWidth;
26 - self.DisplayHeight = proofreadPageHeight;
27 - return proofreadPageURL;
28 - }
 67+ // Image without scaling
 68+ callback( mw.config.get( 'proofreadPageURL' ), fullWidth, fullHeight );
2969 }
3070 }
3171
@@ -90,7 +130,7 @@
91131 }
92132 self.proofreadpage_username = m4[2];
93133 pageHeader = pageHeader.replace( reg, '' );
94 - } else if ( old_m4 ) {
 134+ } else if( old_m4 ) {
95135 switch( old_m4[1] ) {
96136 case '0':
97137 self.proofreadpage_quality = 0;
@@ -142,6 +182,7 @@
143183 var box = document.getElementById( 'wpTextbox1' );
144184 var h = document.getElementById( 'prp_header' );
145185 var f = document.getElementById( 'prp_footer' );
 186+
146187 if( h.style.cssText == 'display:none;' ) {
147188 box.style.cssText = 'height:' + ( self.DisplayHeight - 6 ) + 'px';
148189 } else {
@@ -317,35 +358,32 @@
318359 return false;
319360 }
320361
 362+//zoom using two images (magnification glass)
 363+function pr_initzoom( width, height ) {
 364+ var maxWidth = 800;
321365
322 -//zoom using two images (magnification glass)
323 -function pr_initzoom() {
324 - if( proofreadPageIsEdit ) {
 366+ if( width > maxWidth ) {
325367 return;
326368 }
327 - if( !self.proofreadPageThumbURL ) {
 369+
 370+ zp = document.getElementById( 'pr_container' );
 371+ if( !zp ) {
328372 return;
329373 }
330 - if( self.DisplayWidth > 800 ) {
331 - return;
332 - }
 374+ pr_fetch_thumb_url( maxWidth, function( largeUrl, largeWidth, largeHeight ) {
 375+ self.objw = width;
 376+ self.objh = height;
333377
334 - zp = document.getElementById( 'pr_container' );
335 - if( zp ) {
336 - var hires_url = pr_image_url( 800 );
337 - self.objw = zp.firstChild.width;
338 - self.objh = zp.firstChild.height;
339 -
340378 zp.onmouseup = zoom_mouseup;
341379 zp.onmousemove = zoom_move;
342380 zp_container = document.createElement( 'div' );
343381 zp_container.style.cssText = 'position:absolute; width:0; height:0; overflow:hidden;';
344382 zp_clip = document.createElement( 'img' );
345 - zp_clip.setAttribute( 'src', hires_url );
 383+ zp_clip.setAttribute( 'src', largeUrl );
346384 zp_clip.style.cssText = 'padding:0;margin:0;border:0;';
347385 zp_container.appendChild( zp_clip );
348386 zp.insertBefore( zp_container, zp.firstChild );
349 - }
 387+ } );
350388 }
351389
352390 /********************************
@@ -532,7 +570,7 @@
533571 boxHeight + 'px;background:#000000;';
534572 }
535573 }
536 - if ( evt.preventDefault ) {
 574+ if( evt.preventDefault ) {
537575 evt.preventDefault();
538576 }
539577 evt.returnValue = false;
@@ -556,7 +594,7 @@
557595 }
558596
559597 self.pr_zoom = function( delta ) {
560 - if ( delta == 0 ) {
 598+ if( delta == 0 ) {
561599 // reduce width by 20 pixels in order to prevent horizontal scrollbar
562600 // from showing up
563601 pr_set_margins( 0, 0, pr_container.offsetWidth - 20 );
@@ -587,10 +625,10 @@
588626 return false;
589627 }
590628 var delta = 0;
591 - if ( evt.wheelDelta ) {
 629+ if( evt.wheelDelta ) {
592630 /* IE/Opera. */
593631 delta = evt.wheelDelta / 120;
594 - } else if ( evt.detail ) {
 632+ } else if( evt.detail ) {
595633 /**
596634 * Mozilla case.
597635 * In Mozilla, sign of delta is different than in IE.
@@ -666,9 +704,9 @@
667705 pr_zoom( 0 );
668706 }
669707
670 -function pr_load_image( ) {
 708+function pr_load_image( url ) {
671709 pr_container.innerHTML = '<img id="ProofReadImage" src="' +
672 - escapeQuotesHTML( self.proofreadPageViewURL ) + '" width="' + img_width + '" />';
 710+ escapeQuotesHTML( url ) + '" width="' + img_width + '" />';
673711 pr_zoom( 0 );
674712 }
675713
@@ -704,15 +742,16 @@
705743
706744 // fill the image container
707745 if( !proofreadPageIsEdit ) {
708 - // this sets DisplayWidth and DisplayHeight
709 - var thumb_url = pr_image_url( parseInt( pr_width / 2 - 70 ) );
710 - var image = document.createElement( 'img' );
711 - image.setAttribute( 'id', 'ProofReadImage' );
712 - image.setAttribute( 'src', thumb_url );
713 - image.setAttribute( 'width', self.DisplayWidth );
714 - image.style.cssText = 'padding:0;margin:0;border:0;';
715 - pr_container.appendChild( image );
716 - pr_container.style.cssText = 'overflow:hidden;width:' + self.DisplayWidth + 'px;';
 746+ pr_fetch_thumb_url( parseInt( pr_width / 2 - 70 ), function( url, width, height ) {
 747+ var image = document.createElement( 'img' );
 748+ image.setAttribute( 'id', 'ProofReadImage' );
 749+ image.setAttribute( 'src', url );
 750+ image.setAttribute( 'width', width );
 751+ image.style.cssText = 'padding:0;margin:0;border:0;';
 752+ pr_container.appendChild( image );
 753+ pr_container.style.cssText = 'overflow:hidden;width:' + width + 'px;';
 754+ pr_initzoom( width, height );
 755+ } );
717756 } else {
718757 var w = parseInt( self.proofreadPageEditWidth );
719758 if( !w ) {
@@ -721,17 +760,20 @@
722761 if( !w ) {
723762 w = 1024; /* Default size in edit mode */
724763 }
725 - self.proofreadPageViewURL = pr_image_url( Math.min( w, self.proofreadPageWidth ) );
 764+
726765 // prevent the container from being resized once the image is downloaded.
727766 img_width = pr_horiz ? 0 : parseInt( pr_width / 2 - 70 ) - 20;
728767 pr_container.onmousedown = pr_grab;
729768 pr_container.onmousemove = pr_move;
730 - if ( pr_container.addEventListener ) {
 769+ if( pr_container.addEventListener ) {
731770 pr_container.addEventListener( 'DOMMouseScroll', pr_zoom_wheel, false );
732771 }
733772 pr_container.onmousewheel = pr_zoom_wheel; // IE, Opera.
734 - /* Load the image after page setup, so that user-defined hooks do not have to wait for it. */
735 - hookEvent( 'load', pr_load_image );
 773+
 774+ pr_fetch_thumb_url( Math.min( w, self.proofreadPageWidth ), function( url, width, height ) {
 775+ // Load the image after page setup, so that user-defined hooks do not have to wait for it.
 776+ $( function() { pr_load_image( url ) } );
 777+ } );
736778 }
737779
738780 table.setAttribute( 'id', 'textBoxTable' );
@@ -755,7 +797,7 @@
756798 pr_make_edit_area( self.text_container, new_text.value );
757799 var copywarn = document.getElementById( 'editpage-copywarn' );
758800 f.insertBefore( table, copywarn );
759 - if ( !self.proofreadpage_show_headers ) {
 801+ if( !self.proofreadpage_show_headers ) {
760802 hookEvent( 'load', pr_toggle_visibility );
761803 } else {
762804 hookEvent( 'load', pr_reset_size );
@@ -896,69 +938,36 @@
897939 return;
898940 }
899941
900 - if( document.URL.indexOf( 'action=protect' ) > 0 || document.URL.indexOf( 'action=unprotect' ) > 0 ) {
 942+ if( $.inArray( mw.util.getParamValue( 'action' ), ['protect', 'unprotect', 'delete', 'undelete', 'watch', 'unwatch', 'history'] ) > -1 ) {
901943 return;
902944 }
903 - if( document.URL.indexOf( 'action=delete' ) > 0 || document.URL.indexOf( 'action=undelete' ) > 0 ) {
904 - return;
905 - }
906 - if( document.URL.indexOf( 'action=watch' ) > 0 || document.URL.indexOf( 'action=unwatch' ) > 0 ) {
907 - return;
908 - }
909 - if( document.URL.indexOf( 'action=history' ) > 0 ) {
910 - return;
911 - }
912945
913 - /* check if external URL is provided */
914 - if( !self.proofreadPageThumbURL ) {
915 - var text = document.getElementById( 'wpTextbox1' );
916 - if ( text ) {
917 - var proofreadPageIsEdit = true;
918 - re = /<span class="hiddenStructure" id="pageURL">\[http:\/\/(.*?)\]<\/span>/;
919 - m = re.exec( text.value );
920 - if( m ) {
921 - self.proofreadPageExternalURL = 'http://' + m[1];
922 - }
923 - } else {
924 - var proofreadPageIsEdit = false;
925 - text = document.getElementById( 'bodyContent' );
926 - try {
927 - var a = document.getElementById( 'pageURL' );
928 - var b = a.firstChild;
929 - self.proofreadPageExternalURL = b.getAttribute( 'href' );
930 - } catch( err ) {
931 - };
932 - }
933 - // set to dummy values, not used
934 - self.proofreadPageWidth = 400;
935 - self.proofreadPageHeight = 400;
936 - }
937 -
938 - if( !self.proofreadPageThumbURL ) {
 946+ if( mw.config.get( 'proofreadPageFileName' ) == null ) {
 947+ // File does not exist
939948 return;
940949 }
941950
942951 if( self.proofreadpage_setup ) {
 952+ // Run site/user setup code
943953 proofreadpage_setup(
944 - proofreadPageWidth,
945 - proofreadPageHeight,
946 - proofreadPageIsEdit
 954+ mw.config.get( 'proofreadPageWidth' ),
 955+ mw.config.get( 'proofreadPageHeight' ),
 956+ mw.config.get( 'proofreadPageIsEdit' )
947957 );
948958 } else {
 959+ // Run extension setup code
949960 pr_setup();
950961 }
951962
952963 // add CSS classes to the container div
953 - if( self.proofreadPageCss) {
954 - $( 'div.pagetext' ).addClass( self.proofreadPageCss );
 964+ if( mw.config.get( 'proofreadPageCss' ) != null ) {
 965+ $( 'div.pagetext' ).addClass( mw.config.get( 'proofreadPageCss' ) );
955966 }
956967 }
957968
958969 $(document).ready( pr_init );
959970 $(document).ready( pr_init_tabs );
960 -$(document).ready( pr_initzoom );
961971
962 -
963972 /* Quality buttons */
964973 self.pr_add_quality = function( form, value ) {
965974 self.proofreadpage_quality = value;

Follow-up revisions

RevisionCommit summaryAuthorDate
r95613Reverting r95602 per CRjohnduhart02:05, 28 August 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   01:16, 28 August 2011

This patch seems to make a lot of formatting changes unrelated to the described issue, which makes it hard to find and test the functional part -- can you please revert for now pending review?

The patch posted on the bug report also comes with a warning that it "messes up layout" if the image is big, which may indicate that the image is not being set to the proper on-page size. Let's make sure that's fixed before committing it!

Status & tagging log