Jump to content

Commons:Graphics village pump

Add topic
From Wikimedia Commons, the free media repository
Latest comment: 18 days ago by Glrx in topic why webp for downloaded files?

Shortcut

color palette logo WELCOME TO THE GRAPHICS VILLAGE PUMP!

This Graphics village pump aims to be technical support forum for all the local Labs, graphists (graphic artists), and volunteers interested in graphic works, and is a page where graphists and users from all the Labs can talk about graphics, tutorials, graphic software, help to build new Graphic Labs, etc. Also for exchanging opinions, ideas, protocols, and ways of improvement.

See also: Graphics abilities page | Graphic Tool | Project Insignia | Stroke Order Project | Current requests/discussions

To have the opinion of graphists, check:

Illustration Workshop   Map Workshop   Photography Workshop   Video and Sound Workshop

Graphics village pump archives
Monthly archives
2007 [[../April 2007|Apr]] [[../May 2007|May]] [[../June 2007|Jun]] [[../July 2007|Jul]] [[../August 2007|Aug]] [[../September 2007|Sep]] [[../October 2007|Oct]] [[../November 2007|Nov]] [[../December 2007|Dec]]
2008 [[../January 2008|Jan]] [[../February 2008|Feb]] [[../March 2008|Mar]] [[../April 2008|Apr]] [[../May 2008|May]] [[../June 2008|Jun]] [[../July 2008|Jul]] [[../August 2008|Aug]] [[../September 2008|Sep]] [[../October 2008|Oct]] [[../November 2008|Nov]] [[../December 2008|Dec]]
2009 [[../January 2009|Jan]] [[../February 2009|Feb]] [[../March 2009|Mar]] [[../April 2009|Apr]] [[../May 2009|May]] [[../June 2009|Jun]] [[../July 2009|Jul]] [[../August 2009|Aug]] [[../September 2009|Sep]] [[../October 2009|Oct]] [[../November 2009|Nov]] [[../December 2009|Dec]]
2010 [[../January 2010|Jan]] [[../February 2010|Feb]] [[../April 2010|Apr]] [[../May 2010|May]] [[../June 2010|Jun]] [[../July 2010|Jul]] [[../August 2010|Aug]] [[../September 2010|Sep]] [[../October 2010|Oct]] [[../November 2010|Nov]] [[../December 2010|Dec]]
2011 [[../January 2011|Jan]] [[../February 2011|Feb]] [[../March 2011|Mar]] [[../April 2011|Apr]] [[../May 2011|May]] [[../June 2011|Jun]] [[../July 2011|Jul]] [[../August 2011|Aug]] [[../September 2011|Sep]] [[../October 2011|Oct]] [[../December 2011|Dec]]
2012 [[../January 2012|Jan]] [[../February 2012|Feb]] [[../March 2012|Mar]] [[../April 2012|Apr]] [[../May 2012|May]] [[../June 2012|Jun]] [[../July 2012|Jul]] [[../August 2012|Aug]] [[../September 2012|Sep]] [[../October 2012|Oct]] [[../November 2012|Nov]] [[../December 2012|Dec]]
2013 [[../January 2013|Jan]] [[../February 2013|Feb]] [[../March 2013|Mar]] [[../April 2013|Apr]] [[../May 2013|May]] [[../June 2013|Jun]] [[../July 2013|Jul]] [[../August 2013|Aug]] [[../September 2013|Sep]] [[../October 2013|Oct]] [[../December 2013|Dec]]
2014 [[../January 2014|Jan]] [[../February 2014|Feb]] [[../March 2014|Mar]] [[../April 2014|Apr]] [[../May 2014|May]] [[../July 2014|Jul]] [[../August 2014|Aug]] [[../September 2014|Sep]] [[../October 2014|Oct]] [[../November 2014|Nov]] [[../December 2014|Dec]]
2015 [[../January 2015|Jan]] [[../March 2015|Mar]] [[../April 2015|Apr]] [[../May 2015|May]] [[../June 2015|Jun]] [[../July 2015|Jul]] [[../September 2015|Sep]] [[../October 2015|Oct]] [[../November 2015|Nov]] [[../December 2015|Dec]]
2016 [[../January 2016|Jan]] [[../February 2016|Feb]] [[../March 2016|Mar]] [[../April 2016|Apr]] [[../May 2016|May]] [[../June 2016|Jun]] [[../July 2016|Jul]] [[../August 2016|Aug]] [[../September 2016|Sep]] [[../November 2016|Nov]] [[../December 2016|Dec]]
2017 [[../February 2017|Feb]] [[../March 2017|Mar]] [[../April 2017|Apr]] [[../May 2017|May]] [[../June 2017|Jun]] [[../July 2017|Jul]] [[../August 2017|Aug]] [[../September 2017|Sep]] [[../October 2017|Oct]] [[../November 2017|Nov]] [[../December 2017|Dec]]
2018 [[../January 2018|Jan]] [[../February 2018|Feb]] [[../March 2018|Mar]] [[../May 2018|May]] [[../June 2018|Jun]] [[../July 2018|Jul]] [[../August 2018|Aug]] [[../September 2018|Sep]] [[../November 2018|Nov]] [[../December 2018|Dec]]
2019 [[../January 2019|Jan]] [[../February 2019|Feb]] [[../March 2019|Mar]] [[../April 2019|Apr]] [[../May 2019|May]] [[../June 2019|Jun]] [[../July 2019|Jul]] [[../August 2019|Aug]] [[../September 2019|Sep]] [[../November 2019|Nov]] [[../December 2019|Dec]]
2020 [[../January 2020|Jan]] [[../February 2020|Feb]] [[../March 2020|Mar]] [[../April 2020|Apr]] [[../May 2020|May]] [[../June 2020|Jun]] [[../July 2020|Jul]] [[../August 2020|Aug]] [[../September 2020|Sep]]
2021 [[../March 2021|Mar]] [[../April 2021|Apr]] [[../June 2021|Jun]] [[../July 2021|Jul]] [[../August 2021|Aug]] [[../September 2021|Sep]]
2022 [[../January 2022|Jan]] [[../March 2022|Mar]] [[../April 2022|Apr]] [[../May 2022|May]] [[../June 2022|Jun]] [[../July 2022|Jul]] [[../August 2022|Aug]] [[../September 2022|Sep]] [[../November 2022|Nov]] [[../December 2022|Dec]]
2023 [[../January 2023|Jan]] [[../May 2023|May]] [[../July 2023|Jul]] [[../August 2023|Aug]] [[../October 2023|Oct]] [[../November 2023|Nov]] [[../December 2023|Dec]]
2024 [[../January 2024|Jan]] [[../February 2024|Feb]] [[../April 2024|Apr]] [[../May 2024|May]] [[../June 2024|Jun]] [[../July 2024|Jul]] [[../August 2024|Aug]] [[../September 2024|Sep]] [[../December 2024|Dec]]
2025 [[../February 2025|Feb]] [[../March 2025|Mar]] [[../April 2025|Apr]] [[../May 2025|May]] [[../July 2025|Jul]] [[../August 2025|Aug]] [[../November 2025|Nov]] [[../December 2025|Dec]]
2026 [[../March 2026|Mar]] [[../April 2026|Apr]] [[../May 2026|May]] [[../August 2026|Aug]] [[../September 2026|Sep]] [[../October 2026|Oct]] [[../November 2026|Nov]] [[../December 2026|Dec]]
2027 [[../January 2027|Jan]] [[../February 2027|Feb]] [[../March 2027|Mar]] [[../April 2027|Apr]] [[../May 2027|May]] [[../June 2027|Jun]] [[../July 2027|Jul]] [[../August 2027|Aug]] [[../September 2027|Sep]] [[../October 2027|Oct]] [[../November 2027|Nov]] [[../December 2027|Dec]]
2028 [[../January 2028|Jan]] [[../February 2028|Feb]] [[../March 2028|Mar]] [[../April 2028|Apr]] [[../May 2028|May]] [[../June 2028|Jun]] [[../July 2028|Jul]] [[../August 2028|Aug]] [[../September 2028|Sep]] [[../October 2028|Oct]] [[../November 2028|Nov]] [[../December 2028|Dec]]
Topic-specific archives
  • [[../GIF thread]]

Issues with E-road shields (Tabliczka set)

[edit]

The text of the E-road shields that use the "Tabliczka" format have suddenly become offset to the left: they used to be centred until recently. I wonder what is causing the error, and I also ask who has time to correct the alignment of all 263 shields in the set? (I am currently busy on other parts of Wikipedia) Best, --Minoa (talk) 02:51, 30 July 2024 (UTC)Reply

@Minoa: Apparently the SVG renderer doesn't position non-uniformly scaled text correctly. I.e. there is a transform="scale(0.907522,1.101902)" attribute in the <text> node and removing it makes the text render in the same location as in Inkscape or in the browser.
I don't remember whether this is a known bug and I don't see an elegant way to fix this. If we simply move the text to the right, it'll be too far to the right once the bug is fixed. If we do remove the transform and adjust the position, the characters will have a less narrow shape. Converting the text to paths would solve the rendering issue, but it's just not elegant. TilmannR (talk) 15:41, 30 July 2024 (UTC)Reply
The svg code could be greatly shortened to basic rectangle and text elements, avoiding the sodipodi and other declarations and complications that Inkscape introduced. But with 263 member files in this category, avoiding the rendering problem would be a grueling task. I'd be willing to do a prototype/model file for someone with more time and patience, though I'm not sure which font I should use in place of the disfavored fond-family, Arial. You might also seek advice at WP:SVG help] at en.WP. RCraig09 (talk) 16:47, 30 July 2024 (UTC)Reply
For the record, I tried to reduce the size of the file and successfully validate the SVG code at File:Tabliczka E75.svg and File:Tabliczka E951.svg, but it appears that rsvg is scaling the text towards the left despite the text-anchor="middle" instruction. While it may be tempting to suggest modifying the view-box to have (0,0) at the middle, such a workaround is not possible for something like File:Integral image application example.svg. --Minoa (talk) 08:22, 31 July 2024 (UTC)Reply
I believe TilmannR has diagnosed the issue. I believe the mechanism is as follows. RSVG is asked to center the text. It calculates the width of the text without scaling. Say that is 400 pixels. It then takes 1/2 that value to compute the starting point; the starting point is then 200 pixels left of the anchor point. Then it paints the text, but the scaling is applied while painting. If the scale factor is 0.9, then the text will be 360 pixels wide. The text will appear shifted to the left by 20 pixels. (If the scaling is 1.1, then the text would appear shifted to the right.)
It is a bug in the renderer, so I would ask WMF to fix the renderer rather than tweak the SVG. Fix stuff where it is broken. One check would be whether this bug is present in the most recent version of RSVG.
If the SVG is worked around, I suspect using an x scale factor of 1.0 would avoid the bug; the y scale factor could be different from unity.
Glrx (talk) 14:58, 31 July 2024 (UTC)Reply
x scale > 1, y scale = 1 does shift to the right. x scale = 1, y scale > 1 does not do as I expect (shifts to the left!).
Glrx (talk) 15:32, 31 July 2024 (UTC)Reply

I wish to ask if there is already a Phabricator report for this issue? --Minoa (talk) 15:36, 31 July 2024 (UTC)Reply

User:JoKalliauer diagnosed this problem in Phab:T370044. Glrx (talk) 17:14, 31 July 2024 (UTC)Reply
See also: https://gitlab.gnome.org/GNOME/librsvg/-/issues/1109 (titled: transform of Text in Pattern with text-anchor="middle" not centered). I hope that they will correct the issue soon because I have a plan to compact and validate the SVGs in the Tabliczka set. --Minoa (talk) 09:24, 4 August 2024 (UTC)Reply
For the record, I have marked this topic as active (using {{DNAU}}) until the issue is fixed. The impact of the bug is substantial, because my plan to upload optimised SVG E-road shields has been postponed until I know for sure how the Wikimedia Commons will render them. --Minoa (talk) 07:41, 24 August 2024 (UTC)Reply
@Minoa: Support for condensed fonts is mixed, but I got a reasonable result with
  <text
     style="font-size:84px;font-weight:bold;font-stretch:condensed;text-align:center;text-anchor:middle;fill:#ffffff;font-family:sans-serif"
     x="105"
     y="95"><tspan>E002</tspan></text>
See File:Test.svg 2024-08-24 15:45
Glrx (talk) 15:56, 24 August 2024 (UTC)Reply
Note: Similar issues have been reported on
  1. http://en.wikipedia.org/w/index.php?title=Wikipedia:SVG_help&diff=prev&oldid=1232861961
  2. http://commons.wikimedia.org/w/index.php?title=User_talk%3ACmglee&diff=905204964
cmɢʟee ⋅τaʟκ 00:59, 31 July 2024 (UTC)Reply
Gnome says this issue is fixed in librsvg 2.59.2. Glrx (talk) 20:51, 18 September 2025 (UTC)Reply
Understood: I am keeping an eye on the issue and will clear the topic for archiving once the fixes are visible on the Commons. --Minoa (talk) 20:54, 18 September 2025 (UTC)Reply

Dominant baseline does not work

[edit]

Why does Commons' SVG renderer not understand dominant-baseline? Can this be fixed? The images shown on the right work in every browser. This seems to be the only reliable way to vertically center text in SVG. So it would be very handy to have this. Greetings, Watchduck (quack) 16:01, 9 July 2026 (UTC)Reply

@Watchduck: I don't have an answer, but there is specialized expertise at SVG help on the English Wikipedia. RCraig09 (talk) 20:50, 9 July 2026 (UTC)Reply

why webp for downloaded files?

[edit]

Hello, for many years when I download a thumbnail (500 pixels or 480 pixels) of an SVG file, the downloaded file is usually in PNG format. Now I find the file in "webp" format which is not supported by most image editing applications. I have tried several times with several files and the same thing happens. Why are the files downloading in this format? Have there been any changes made to Commons? And are there any gadgets that disable this feature and restore the download to PNG format? Ibrahim.ID 14:40, 30 July 2026 (UTC)Reply

@Ibrahim.ID: I think .webp files take up fewer bytes. You can change the .webp document into other formats at https://cloudconvert.com/webp-converter . Other editors might have other observations. RCraig09 (talk) 19:34, 30 July 2026 (UTC)Reply
Do you have an example file? I tried out a random SVG and got the usual thumbnail URL format, viz. https://upload.wikimedia.org/wikipedia/commons/thumb/#/##/filename.svg/###px-filename.svg.png. — Arlo James Barnes 18:33, 17 August 2026 (UTC)Reply
Here's what I ran into.
Consider File:Conic Sections.svg.
A thumbnail is https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Conic_Sections.svg/500px-Conic_Sections.svg.png?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=thumbnail
That looks like it should be a PNG file, but if I follow that link and try to save it, my browser wants to save it as Conic_Sections.svg.webp.
Looking at the HTTP request/response:
The "png" thumbnail request included
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
The "png" thumbnail image was served as
content-type: image/webp
I do not know the processing steps. In the past, librsvg generated PNG files. Maybe it has changed, maybe it now generates WEBP, or maybe the PNG is converted to WEBP before being served.
Glrx (talk) 17:56, 20 August 2026 (UTC)Reply