"Wikitravel has a speed and convenience the books' publishers can only envy." Time Europe

Tech:Images Compression of Thumbs

From Wikitravel Shared
Jump to: navigation, search

Moved from en:Wikitravel:Bug reports 1.4.x-1.5.x/Fixed by Evan

Hope this is the right place to report this bug(?). I have just started to work in the wikitravel.org/de and found a problem with scaled images, especially vector-based PNGs. When intergrating an image with a scaled-down width (e.g.: 220px) like I'm used to from wikipedia, I find the resulting thumb rather distorted; words in maps are hard to read and lines appear broken. See the maps in this article for example: Phangan. The same effect can be seen here in the english-language wikitravel (I have tried it with some maps, only in preview-mode though). Is this intentional, to reduze the size of data stored on the servers, or maybe a bug? Tsui 17:07, 29 Oct 2004 (EDT) (> de:Tsui)

Thumbnailing is intended only for photographic images. Maps should always be placed in the article at full size, using [[:en:Image:picture|right]] instead of thumbnails. And amazing work on Koh Phangan, by the way, I'll be borrowing much of it for en-wiki! Jpatokal 01:26, 30 Oct 2004 (EDT)
By the way, you can cut down the map image size radically by converting it from 24-bit RGB to indexed (64-color). en::Image:Phangan_Map.png (my translated version) is now only 55k, instead of 240k! Jpatokal 02:22, 30 Oct 2004 (EDT)
I dunno if I agree that thumbnails should only be for photographic images. I think it looks nicer to have text wrapping around the image. If you look at the image pages for the maps I've been making you'll notice that I've been making numbered lists from the listings on the destination page and putting numbered icons on the maps. This (I hope) makes for a good, printable, map page. If the map is in thumbnail form then users will click through to see the map page, otherwise they likely won't, and then the little numbered icons don't make any sense anymore.
I could be wrong but I think a little tweaking of the thumbnail making bit might result in nicer looking pngs.. (Mediawiki uses ImageMagick no? ) -- Mark 03:06, 30 Oct 2004 (EDT)
The primary reason I suggest keeping maps in full in the article is to allow the user to print the thing once, instead of having to print out the map separately. A thumbnailed map where streets and places are illegible is of little use to anybody. And hey, in a couple of years time when everybody has a 4096x4096 monitor this will cease to be an issue... Jpatokal 03:46, 30 Oct 2004 (EDT)
OK, so maybe include all of the maps you make in the article full size... I'd rather be able to make my maps large and on a seperate page. I actually think it's more convienient for travellers that way. -- Mark 03:58, 30 Oct 2004 (EDT)
It looks like there's a setting which tells Mediawiki to use ImageMagick as opposed to the PHP built in image manipulation stuff. I'm not sure how that's set now, but I do know that in the tests I just did ImageMagick did a much better job on pngs than wikitravel does.
It also looks from the source code like thumbnail support for png images is most definetly intended. Actually the newest version appears to support automated conversion of svg to png.
If we do have the $wgUseImageMagick setting turned on then perhaps the fact that a quality of 85 is hard coded into the software is causing the problem:

			} elseif ( $wgUseImageMagick ) {
				# use ImageMagick
				# Specify white background color, will be used for transparent images
				# in Internet Explorer/Windows instead of default black.
				$cmd  =  $wgImageMagickConvertCommand .
					" -quality 85 -background white -geometry {$width} ".
					escapeshellarg($this->imagePath) . " " .
					escapeshellarg($thumbPath);				
				$conv = shell_exec( $cmd );

That pretty clearly is at least a stylistic bug: the 85 is a classic "magic number" as per Kernighan and Ritchey for which there should be a setting somewhere. -- Mark 04:38, 30 Oct 2004 (EDT)
I'm new to wikitravel, so of course I don't want to start a 'revolution' with the first edits I make. But I agree with what Mark wrote above: as a traveller who uses internet-cafés a lot, I would also prefer to have a preview of a map in the article and only view it full-size if I need to. Especially country-maps (like the CIA-maps without roads, trains, ferries etc.) are usually not really necessary when I'm in the country already. I don't know much about server-side image editing and MediaWiki, but isn't it possible to use a similar tool or setting as in wikipedia (which doesn't distort graphics that much)?
By the way, of course you're welcome to use maps or pictures I put on wikitravel-de - that's what the CC-by-SA license is about - but please add the source (creator, not website) and license. The images are not simple Public Domain. Thanks in advance ;-) --Tsui 11:18, 30 Oct 2004 (EDT)

I've changed the settings on our server to use the external ImageMagick program. I have no idea if that's going to help or not. I also really favor manual thumbnailing of vector images -- taking out text, minor features, etc. -- rather than depending on software to do it.

As to the license: ALL images on Wikitravel are by-sa 1.0. There's no reason to add license information. If it's not available under our license, don't upload it to Wikitravel. I plan to add attribution info for embedded images into the next version of MediaWiki, so image creators get attributed at the bottom of a page just like other contributors. Hopefully this obviates the need for adding extra info to the articles. --Evan 15:22, 30 Oct 2004 (EDT)

Manual thumbnails sound like a fantastic idea in this case. I'd love to have them in en:Paris, but I don't know how to make one image link to the Image page for another image altogether. Is this possible? -- Mark 15:34, 30 Oct 2004 (EDT)
Are all images CC-by-SA? As I understand it: when using Public Domain images they stay in Public Domain and can't be "re-licensed" as by-SA. Also the attribution is not exactly what I believe by-SA is about, not completely I mean. When an image from wikitravel-fr, -ro or -de is loaded up here by a different user it would be attributed to him/her (automatically?), not the origininal creator.
The manual thumbnails would be a great addition. I'm looking forward to that. --Tsui 17:25, 30 Oct 2004 (EDT)

Variants

Actions

In other languages