Commons:Graphics village pump/May 2015

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

GlobalReplace on itwiki

Not sure if this is the right place for this (please point me elsewhere if not).

I've been running GlobalReplace 0.3 to mass-replace some of the highest use raster files (e.g. File:600px Rosso e Nero.png) but unfortunately my edits on the Italian wiki were reverted and my account blocked for a day for "unauthorised bot". Does anyone familiar with that wiki know how I should go about making the edits if not with that tool? There are several templates which are transcluded to several hundred pages each which probably account for most of the uses but I think there are possibly thousands of individual cases as well. Unfortunately I don't speak Italian whatsoever so I'm not in a position to argue my case there. NikNaks talkgallerywikipedia 20:43, 3 May 2015 (UTC)

If no one here is able to help, you may want to try the it embassy Offnfopt(talk) 03:22, 4 May 2015 (UTC)
Why you not simply give this back to the source/root → Commons talk:GlobalReplace, this can happen to everybody to every project again, so I mean don't spread this issue to every case (I had the same issue there)User: Perhelion (Commons: = crap?)  05:56, 4 May 2015 (UTC)
Thanks for the tips. I think I'll try out the embassy first and see what happens. I have to say I've made several of these mass changes before and never had a problem as far as I know, so perhaps it's just overzealous administration from the odd wiki from time to time that blocks it! Anyway, thanks again. NikNaks talk - gallery - wikipedia 09:30, 4 May 2015 (UTC)

spurious text in SVG rendering

A en.wikipedia user pointed out that there was spurious text at the left of the diagram which is here: File:Call stack layout.svg. I looked at most of the canned PNG renderings, and sure enough, almost all have junk there (e.g. "ress" and "for"). But not all do: apparently [1] is ok, as is the rendering on the File: page itself. I think the rest have the junk, which looks the same to me on all of them.

I don't know when this started. As far as I know thing haven't changed for years (except underlying wikimedia software). Any ideas about what the deal is here? --R. S. Shaw (talk) 23:04, 30 April 2015 (UTC)

@R. S. Shaw: I'm not sure what the problem was, but the markup was a bit overly complicated due to the way inkscape generates the SVG markup, so I went ahead and just re-created the image from scratch and all is good now. Offnfopt(talk) 08:44, 1 May 2015 (UTC)
I suppose that's a fair workaround. One problem with the new version is that the fonts seem to be too small to make the in-line diagram readable in an article, e.g. in en:Call stack. A lesser issue is that it doesn't have the vertical ellipsis at the bottom to indicate the stack goes on in that direction.
There may be a bigger issue, though, in that a recent change to SVG rendering software on Commons may have broken other images. Eventually I realized that the "spurious text" I saw was most likely the text missing from the inside of the boxes -- essentially it had been rendered in a different position than (presumably) specified, perhaps with a negative offset from the left margin rather than a positive one. Such a thing could affect (perhaps many) other images and maybe needs looking into. --R. S. Shaw (talk) 05:08, 2 May 2015 (UTC)
I've done the file again (in your dimensions, but the file from Offnfopt was structurally already very good). The file seems exported from an PDF and (the code is very creepy) there seems several bugs together (bugs like this: phab:T36947, phab:T65703 and in all phab:T35245 and actually also phab:T97233, see above).User: Perhelion (Commons: = crap?)  08:00, 2 May 2015 (UTC)
Thanks for that cleanup; looks great. I can't recall how the diagram was generated; I expect it did involve Inkscape, but don't know whether a PDF or raster input was involved. --R. S. Shaw (talk) 17:35, 7 May 2015 (UTC)

Problem rendering chemical structures

I recently upladed multiple biochemical structure of some compounds (, etc.) and most of them rendered with mistakes. They were produced and exported from ChemDraw 12. When I open them in inkscape, they show fine. I checked them with svgcheck, no problems found. How can I solve this issue?

Thank you for your kind advice. --Wesalius (talk) 07:59, 19 April 2015 (UTC)

Haven't looked at those files, but if the subscripts are out of place, then it's probably because the program has different levels of <tspan> embedding side-by-side. For example, in <tspan>ABC<tspan>DEF</tspan></tspan>, "ABC" is inside one level, while "DEF" is inside two levels... AnonMoos (talk) 14:01, 19 April 2015 (UTC)
@Wesalius: I manually fixed both of them using a text editor. If you have any others with problems feel free to post them and I'll try to get to them. Offnfopt(talk) 02:42, 24 April 2015 (UTC)
@Offnfopt: If it is possible, could you explain the fix? I cant ask you to work on all of them, because there is just too many of them. Thank you very much! --Wesalius (talk) 05:28, 24 April 2015 (UTC)
I just figured out I could just see the diff of the old and new file in text editor, so probably less explaining will be needed. --Wesalius (talk) 05:32, 24 April 2015 (UTC)
@Wesalius: I think the bulk of the problems are from the font you're using. You're using Arial, but Wikipedia can't use Arial because of licensing issues so instead a font like "Bitstream Vera Sans" gets used. This font has different proportions than Arial so the text gets moved around. I think if you install this font and set it in your editor(s) ChemDraw or Inkscape I think you'll be able to see how the text alignment changes. When I edit these type of files I am on auto drive so I may have done more and not realized it, so if you still have problems just post and I'll try to respond.Offnfopt(talk) 06:30, 24 April 2015 (UTC)
I wanted to add that SVG markup errors can also cause bad rendering, so you can check the SVG markup by using W3C validator, I use the "Validate by File Upload" often to check my files. I remembered that you had some id="" that had the same id and a id should have a unique name that is only used once in the file, I think this was a problem caused by the editor programs and nothing you did, but just something to look out for. Offnfopt(talk) 06:42, 24 April 2015 (UTC)
OK thanks. I will return with more questions when I try to fix some of the files myself. I just wanted to check if you are using any sfotware/tool beside the validator that cleans up the SVGs for better readability, because when I compared your version and the old one produced by chemdraw, it contains less characters, has tags on sepaseparate lines etc. --Wesalius (talk) 08:02, 24 April 2015 (UTC)
Actually "Arial" gets replaced with "Liberation Sans" by MediaWiki Servers, which has almost identical metrics. So no problem here!
However if I remember correctly (I fixed some similar files before) there are some weird transformations added to the labels, which the SVG renderer can't cope with and therefore shows the text shifted. If I remember correctly ungrouping the conflicting groups while simplifying/merging the transformations did the trick for me (Inkscape can do this automatically in many cases if editing SVG code seems inconvenient). --Patrick87 (talk) 08:58, 24 April 2015 (UTC)
Wesalius, I just used Notepad++ to fix those, but I use search and replace regular expressions heavily to semi-automate redundant tasks.Offnfopt(talk) 15:12, 24 April 2015 (UTC)
@Wesalius: Seems the problem is for some reason RSVG, the software wikipedia uses to convert SVG to PNG files (1) is a bit off when it scales text (2) when the text-anchor is set to use "end" RSVG doesn't seem to be able to handle this correctly. I went ahead and fixed a bunch of the files, but if I missed some now you know what the problem is. You can use text-anchor start or middle but you will have to re-adjust your text position after changing this. I normally set mine to middle, I didn't do this though and just changed as little as I could to get it working (for speeds sake) so I could go through the files faster. If you have problems with any of the files post here.Offnfopt(talk) 09:14, 25 April 2015 (UTC)
Not fully, this is in relation due the tspan elem. needs a dimension attr. from his parent element text not from his neighbor tspan (so a x/y value on tspan is not supported with text-anchor, it seems except of the last one). I opt. the file exemplary.User: Perhelion (Commons: = crap?)  11:20, 25 April 2015 (UTC)
PS: I open a minor bug-report.User: Perhelion (Commons: = crap?)  21:07, 25 April 2015 (UTC)
If this code is really from ChemDraw, I propose to mention this failure there, it is very unlikely code. So I mean librsvg should not be fixed there.User: Perhelion (Commons: = crap?)  11:15, 26 April 2015 (UTC)

The formula was overwritten by User:Hattrich with an ionization (pixel/raster) version...? As far as I understand this is individually and not necessary. (Leyo what do you mean here? And I also mean the white background is not needed!?‎‎)User: Perhelion (Commons: = crap?)  16:23, 28 April 2015 (UTC)

To clarify. Me and Hattrich are working on a medschool project. Hattrich went on and deployed her own workaround for this render problem. Hattrich exports the compound as a jpeg from ChemDraw and than vectorizes it with Inkscape. Which I find ok, but Hattrich went on and changed the form of the aminoacids to ionized version and has overwritten the non-ionized forms. It is fixed now, Hattrich now uploads the ionized versions with a discriminator, so both forms are available.

I will probably upload now the last batch of compounds and hope for the best (or try to fix it if someone explains how in plain English) with the rendering problem. Thank you for your input so far! --Wesalius (talk) 18:41, 28 April 2015 (UTC)

Okay I was only wondering, then go ahead. Thanks too.User: Perhelion (Commons: = crap?)  20:16, 28 April 2015 (UTC)
Example structure created as described

@Wesalius: Please use the settings as given in this table. If you send me an e-mail, I will send you the corresponding .cds file.
I get the best results, if I first save the structure as .eps. I then convert the .eps to .svg using Scribus. Just try it and you won't have rendering problems again. --Leyo 20:21, 28 April 2015 (UTC)


Well I got it working after a long fight with scribus and ghostscript. Now I am curious, is transparent background in chemical compound images such as these preferable? Or should we keep it white? --Wesalius (talk) 09:56, 9 May 2015 (UTC)

Picasa

Does anyone know anything about Picasa? When I scan my 6x6 slides on and try to process them in Picasa, it goes ok until I try to save them, then I get the message: "Cannot save this file. Either the disc is full or is read-only." Have tried clearing the cache, also saving in a different folder, but it makes no difference. I have no trouble with 35mm slides, just the 6x6 ones.

Sardaka (talk) 07:52, 14 May 2015 (UTC)

Scaling down problem with gradients/blur?

As you can see on the 9x and 10x images, when these disc images are scaled down to 15px, they lose the white flash which is visible on the others, and indeed on 16px sizes and up. The files are quite human-readable, so hopefully you'll be able to see the way that the gradient, blur and transform effects are applied. Is this just a MediaWiki bug, or is there something I can do to fix it? And either way, which part is it that might be causing the problem? NikNaks talk - gallery - wikipedia 00:53, 8 May 2015 (UTC)

The problem is with RSVG (i.e. the software commons/wikipedia use to convert SVGs to PNGs). This is the template I've seen used on the images with this problem: {{Rsvg bug|Gaussian blur filter not rendered correctly at small sizes (disappearing completely at very small sizes). See [[:bugzilla:42090]].}}
Check out bugzilla:42090 for more details. I'm still fairly new to SVG markup (still learning) so don't have the experience yet with different work arounds for RSVG bugs, so I don't have much advice to give, but maybe this will point you in the right direction. Offnfopt(talk) 02:46, 8 May 2015 (UTC)
Yep, that looks like the culprit. Looks like there's nothing to be done other than remove the blur effect. Oh well. Thanks! NikNaks talk - gallery - wikipedia 15:13, 8 May 2015 (UTC)
This will hopefully be fixed soon: The latest upstream librsvg already contains the fix. All that is left to be done is to update the version of librsvg running on Wikimedia servers. --Patrick87 (talk) 14:35, 25 May 2015 (UTC)