Given an image of width say 100, the code "[[Image:Name|100px]]" causes MediaWiki to generate a 100px thumbnail. Besides wasting disk space, this bug is annoying since the thumbnail is often larger than the original image.
Attached is a 1-character patch against CVS head that should fix the problem.
(This is my first time submitting a patch for MediaWiki. Is this the right place? Or should I file a bug report on bugzilla instead?)
-- [[en:User:Dbenbenn]]
David Benbennick wrote:
Given an image of width say 100, the code "[[Image:Name|100px]]" causes MediaWiki to generate a 100px thumbnail. Besides wasting disk space, this bug is annoying since the thumbnail is often larger than the original image.
Attached is a 1-character patch against CVS head that should fix the problem.
First, you need to define the problem.
Is the problem that a thumbnail is generated for a size of 100px? That's not a problem; that's a deliberate feature! Transferring a 4 megabyte photograph instead of a 70kb thumbnail doesn't make a lot of sense.
Is the problem that sometimes the generated thumbnail has a larger filesize than the source file? Note that there are already some bugs filed in bugzilla about the "sometimes a thubmnail is larger than the source file" problem. It's unclear what the best solution is. You should probably start with the existing bug reports on the subject.
(This is my first time submitting a patch for MediaWiki. Is this the right place? Or should I file a bug report on bugzilla instead?)
Bugzilla is the place. Besides the problem that something posted here will not be maintained in a queue if it's not acted on immediately, attachments usually do not pass through the list as we've disabled binary attachments due to virus problems in the past.
-- brion vibber (brion @ pobox.com)
On 5/30/05, Brion Vibber brion@pobox.com wrote:
David Benbennick wrote:
Given an image of width say 100, the code "[[Image:Name|100px]]" causes MediaWiki to generate a 100px thumbnail. Besides wasting disk space, this bug is annoying since the thumbnail is often larger than the original image.
Attached is a 1-character patch against CVS head that should fix the problem.
First, you need to define the problem.
Is the problem that a thumbnail is generated for a size of 100px? That's not a problem; that's a deliberate feature! Transferring a 4 megabyte photograph instead of a 70kb thumbnail doesn't make a lot of sense.
Not having looked at the patch or the code, I think he was saying that a thumb would get generated even if the width of the image is the same as the would-be thumb.
On 5/29/05, Dori slowpoke@gmail.com wrote:
Not having looked at the patch or the code, I think he was saying that a thumb would get generated even if the width of the image is the same as the would-be thumb.
Yes, that's what I meant. Sorry to be unclear.
I'll list it on Bugzilla tomorrow. The patch is simply:
--- includes/Image.php 28 May 2005 06:57:59 -0000 1.96 +++ includes/Image.php 30 May 2005 02:52:42 -0000 @@ -907,7 +907,7 @@ return null; }
- if( $width > $this->width && !$this->mustRender() ) { + if( $width >= $this->width && !$this->mustRender() ) { # Don't make an image bigger than the source return new ThumbnailImage( $this->getViewURL(), $this->getWidth(), $this->getHeight() ); }
(silly binary attachments!)
wikitech-l@lists.wikimedia.org