NATION

PASSWORD

SVG nation flags

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

SVG nation flags

Postby [violet] » Tue Oct 12, 2021 11:56 pm

Hello Technical,

Because Internet Explorer died and the internet became a better place, we are now testing SVG flags. Please use this thread to report any hijinks or weirdness.

The main changes are:

(1) Most old tiny inbuilt PNG flags have been replaced with sleek SVG alternatives, which look much better at larger sizes.

(2) You can upload SVG flags -- although this doesn't support all SVG images, because we aggressively screen out images that contain potentially dangerous code, or really even anything that looks a bit like it might have potentially dangerous embedded code if you squint.

As usual, please supply as much detail as you can in bug reports, including your browser/device type, as well as whether you're using a non-default NS theme. If there is a particular image that the server is choking on and you want me to investigate, please upload a copy of it somewhere.

--v

User avatar
Valentine Z
Postmaster-General
 
Posts: 13013
Founded: Nov 08, 2015
Scandinavian Liberal Paradise

Postby Valentine Z » Wed Oct 13, 2021 12:02 am

Ooooh, neat! I can't wait to try this out with my flags, hehe.

Thanks, Violet!

Edit: It works! Ohhh, boy, it's so clear! ❤️
Last edited by Valentine Z on Wed Oct 13, 2021 12:09 am, edited 1 time in total.
Val's Stuff. ♡ ^_^ ♡ For You
If you are reading my sig, I want you to have the best day ever ! You are worth it, do not let anyone get you down !
Glory to De Geweldige Sierlijke Katachtige Utopia en Zijne Autonome Machten ov Valentine Z !
(✿◠‿◠) ☆ \(^_^)/ ☆

Issues Thread Photography Stuff Project: Save F7. Stats Analysis

The Sixty! Valentian Stories! Gwen's Adventures!

• Never trouble trouble until trouble troubles you.
• World Map is a cat playing with Australia.
Let Fate sort it out.

User avatar
Cereskia 2
Spokesperson
 
Posts: 169
Founded: Jul 04, 2021
Ex-Nation

Postby Cereskia 2 » Wed Oct 13, 2021 12:06 am

I would bring Scrontch's flag designer to the light for some testing.
Herro Prease, am Cereskia 2: Electric Boogaloo

Oh yeah, and who da fock is Alastair?????
P.S: These people don't know how to spell "Stickmin" correctly, *Le Facepalm*
Get a load of this adbot sh!t.
-Taco and Dave Panpa.

User avatar
Valentine Z
Postmaster-General
 
Posts: 13013
Founded: Nov 08, 2015
Scandinavian Liberal Paradise

Postby Valentine Z » Wed Oct 13, 2021 12:11 am

Without sounding like I'm trying to pry open a rule or trying to find a loophole, I have to ask...

By dangerous SVG, does that mean images with hidden / offensive / illegal codes hidden inside, or are we also including technically dangerous ones (for example, tracing an image into a SVG can lead to a very huge sets of lines and points that might take a while to load or render).

Thanks in advance!

Edit: For those (including me, actually) who didn't know about the dangers of SVG: https://blog.online-convert.com/svg-fil ... ts-danger/. Disclaimer that I am not here to show how, nor do I know how to embed such a thing.

Edit 2: I think I found the very first glitch / quirk / issue: https://www.nationstates.net/nation=val ... ensusid=34

Flags are prohibitively big for stat graphs. On Chrome, both on my phone and on my laptop.
Last edited by Valentine Z on Wed Oct 13, 2021 12:33 am, edited 6 times in total.
Val's Stuff. ♡ ^_^ ♡ For You
If you are reading my sig, I want you to have the best day ever ! You are worth it, do not let anyone get you down !
Glory to De Geweldige Sierlijke Katachtige Utopia en Zijne Autonome Machten ov Valentine Z !
(✿◠‿◠) ☆ \(^_^)/ ☆

Issues Thread Photography Stuff Project: Save F7. Stats Analysis

The Sixty! Valentian Stories! Gwen's Adventures!

• Never trouble trouble until trouble troubles you.
• World Map is a cat playing with Australia.
Let Fate sort it out.

User avatar
SherpDaWerp
Technical Moderator
 
Posts: 1895
Founded: Mar 02, 2016
Benevolent Dictatorship

Postby SherpDaWerp » Wed Oct 13, 2021 12:31 am

[violet] wrote:we aggressively screen out images that contain potentially dangerous code, or really even anything that looks a bit like it might have potentially dangerous embedded code if you squint.

Without revealing anything about how you conduct said screening, how much animation is going to pass this filter?

For instance, I'd consider "upgrading" my current flag to a SVG file if color-changing (see the flag) is going to be fine, but I'd rather not waste 2-3 hours creating a SVG only to find out it doesn't work.

EDIT: Although, now I look at it - I really wouldn't mind playing with event handlers, but I understand they've got about a snowball's chance of hell in passing the screening. Will any events like onclick or onmouseover work?
Last edited by SherpDaWerp on Wed Oct 13, 2021 12:34 am, edited 1 time in total.
Became an editor on 18/01/23 techie on 29/01/24

Rampant statistical speculation from before then is entirely unofficial

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Oct 13, 2021 12:54 am

Valentine Z wrote:By dangerous SVG, does that mean images with hidden / offensive / illegal codes hidden inside, or are we also including technically dangerous ones (for example, tracing an image into a SVG can lead to a very huge sets of lines and points that might take a while to load or render).

We check for file size, and deny anything with script tags. We also compress pretty aggressively.

SherpDaWerp wrote:EDIT: Although, now I look at it - I really wouldn't mind playing with event handlers, but I understand they've got about a snowball's chance of hell in passing the screening. Will any events like onclick or onmouseover work?

No JavaScript is supported. Animation, I'm not sure... how would you implement it? If it's a style tag, it might work.

User avatar
Allinburg
Diplomat
 
Posts: 890
Founded: Feb 13, 2015
Left-wing Utopia

Postby Allinburg » Wed Oct 13, 2021 1:50 am

svg lookin' sharp!!

tho the large flag bug persists on chrome (94.0.4606.81), firefox (93.0) and safari (15.0) on my computer

also safari (both desktop and phone) displays svg flags as a compressed and pixelated preview, instead of outright showing the svg
AllinburgAllinea
IC☄ NS-Statsどこ?
OOC ‣ alie・♂️/・a-nyo-rak・no unsolicited TGs・©

status: lurking at anyone with a modicum of sass

User avatar
SherpDaWerp
Technical Moderator
 
Posts: 1895
Founded: Mar 02, 2016
Benevolent Dictatorship

Postby SherpDaWerp » Wed Oct 13, 2021 3:06 am

[violet] wrote:No JavaScript is supported. Animation, I'm not sure... how would you implement it? If it's a style tag, it might work.

I've no idea how I'd implement it; I've never played with SVG before. My question was moreso testing the waters so I don't go down a rabbit-hole of making, say, a JS-animated flag only to find out that no JS works.

At a 5-minute guess, my first thing to try would be a "base frame" of my current design, in white, with a CSS-based changing color filter applied to it. Example code copied from wikipedia:
Code: Select all
<style type="text/css">
    @keyframes animate_color {
        0%   {background-color: red;}
        25%  {background-color: yellow;}
        50%  {background-color: blue;}
        100% {background-color: green;}
    }
    .animated { animation: animate_color 1s linear infinite; }
</style>

I don't have a lot of free time to experiment atm, so unless I really want to procrastinate my work I won't be able to get much more concrete than that for a few weeks or so. I don't expect the system to be changed around animation, my flag is fine as-is, so as long as there's support for style tags I'll try and figure something out - and if nothing works, so be it.
Became an editor on 18/01/23 techie on 29/01/24

Rampant statistical speculation from before then is entirely unofficial

User avatar
The Onox Legion
Attaché
 
Posts: 88
Founded: Sep 20, 2021
Ex-Nation

Postby The Onox Legion » Wed Oct 13, 2021 3:18 am

Works from my end
Can recommend Armoria dearly
Last edited by The Onox Legion on Wed Oct 13, 2021 3:32 am, edited 1 time in total.
A bandit state lying in the Center of the Southern Hylian Continent.
Raiding, destruction, partying are all part of the program.
The World is one where the three timelines have merged a while ago, but tensions have risen.
OOC: Check out the Pocket Guide for a better F7
NS stats have been beaten up and gotten their wallets taken, they don't count.

"Having some political Ideology is in no way a replacement for having a personality" - General Onox
Ask questions here

Anti-Realism Gang! Putting Real Life stuff in here is disgusting at a conceptual level!

User avatar
Refuge Isle
Technical Moderator
 
Posts: 1873
Founded: Dec 14, 2018
Left-wing Utopia

Postby Refuge Isle » Wed Oct 13, 2021 8:53 am

Greetings,

It appears as though this change has caused the SVG flags to display at a default 900x600 on the reports page, as well as a given page's no-template pages. I presume this is undesired operation. Certainly it causes an amount of inconvenience between the hours of update.

User avatar
Republic Of Ludwigsburg
Diplomat
 
Posts: 863
Founded: Jun 26, 2021
Inoffensive Centrist Democracy

Postby Republic Of Ludwigsburg » Wed Oct 13, 2021 9:01 am

Pretty buggy, changes the ratio of the flag, makes it buggy in the activity page, and the preview in the "create your own flag" page is broken.
Pro: Social Democracy, EU, LGBTQ+ Rights, Labour Party, Ukraine
Anti: Fascism, State Capitalism, Stalinism, Tankies supporting Russia, Nazism
bumbling fool
Politiscales: this
South German Times: Friedrich Schonbrunn diagnosed with Stage 1 Head and Neck Cancer, Gottfried Hallemark to immediately succeed. GDR President Alfred Wolff in grave controversy after calling rival candidate Jakob Silberstein a "schwein" during debate. Joe Biden to host NATO meeting in New York regarding aid to Ukraine. Alpine mountaineer Valentina Giatte successfully summits Mt. Everest. Former Kanzler Johan Schauff to create new hot beverage company, "Schauffee". SPECIAL: The Curious Case of James Friedenwahl: To find out more, log on to timessgermany.eu

User avatar
Broceliande
Civil Servant
 
Posts: 9
Founded: Jul 11, 2014
Ex-Nation

WTFlag?

Postby Broceliande » Wed Oct 13, 2021 9:31 am

Just yesterday, my Flag suddenly became huge and fills up the whole page, requiring to scroll down most of a page to get to the content on the main page.

WTF? Is there a way I can manage this appearance?
Was there some site change, or is this some kind of error or glitch?
I use one of the default supplied flags, btw.

edit:
I've also noticed that the flag indicator on the trend page is also embiggened. So this really can't be intentional, because this renders that chart non-functional.

Can we please fix this?
Last edited by Broceliande on Wed Oct 13, 2021 9:46 am, edited 1 time in total.

User avatar
Merni
Ambassador
 
Posts: 1800
Founded: May 03, 2016
Democratic Socialists

Postby Merni » Wed Oct 13, 2021 9:48 am

On "Antiquity" theme, nations pages for nations with SVG flags show massive flag images that take up the entire page width or more.
2024: the year of democracy. Vote!
The Labyrinth | Donate your free time, help make free ebooks | Admins: Please let us block WACC TGs!
RIP Residency 3.5.16-18.11.21, killed by simplistic calculation
Political Compass: Economic -9.5 (Left) / Social -3.85 (Liberal)
Wrote issue 1523, GA resolutions 532 and 659
meth
When the people are being beaten with a stick, they are not much happier if it is called 'the People’s Stick.' — Mikhail Bakunin (to Karl Marx)
You're supposed to be employing the arts of diplomacy, not the ruddy great thumping sledgehammers of diplomacy. — Ardchoille
The West won the world not by the superiority of its ideas or values or religion [...] but rather by its superiority in applying organised violence. — Samuel P. Huntington (even he said that!)

User avatar
Durm
Attaché
 
Posts: 99
Founded: Jun 16, 2020
Psychotic Dictatorship

Postby Durm » Wed Oct 13, 2021 10:35 am

When you haven't chosen a flag yet, the nation creation page shows the default flag like it always has done, but the selection thing says Aaland Islands. When you create a nation without choosing a flag, it has the Aaland Islands flag.
Last edited by Durm on Wed Oct 13, 2021 11:16 am, edited 3 times in total.
Visoraxus Holoratus Starkiller

There is no good and evil, there is only evil, and those too good to be evil. Embrace malice or malice will be forced upon you. Peace was always a lie.

User avatar
Haganham
Minister
 
Posts: 3065
Founded: Aug 17, 2021
Psychotic Dictatorship

Postby Haganham » Wed Oct 13, 2021 2:52 pm

Does this mean there's hope for svg support elsewhere?
Imagine reading a signature, but over the course of it the quality seems to deteriorate and it gets wose an wose, where the swenetence stwucture and gwammer rewerts to a pwoint of uttew non swence, an u jus dont wanna wead it anymwore (o´ω`o) awd twa wol owdewl iws jus awfwul (´・ω・`);. bwt tw sinawtur iwswnwt obwer nyet, it gwos own an own an own an own. uwu wanyaa stwop weadwing bwut uwu cwant stop wewding, uwu stwartd thwis awnd ur gwoing two fwinibsh it nowo mwattew wat! uwu hab mwoxie kwiddowo, bwut uwu wibl gwib ub sowon. i cwan wite wike dis fwor owors, swo dwont cwalengbe mii..

… wbats dis??? uwu awe stwill weedinb mwie sinatwr?? uwu habe awot ob detewemwinyanyatiom!! 。◕‿◕。! u habve comopweedid tha signwtr, good job!

User avatar
Cain EL v1
Civilian
 
Posts: 1
Founded: Jul 28, 2021
Ex-Nation

Postby Cain EL v1 » Wed Oct 13, 2021 3:12 pm

This nation's flag, the flag of Sweden, seems to be invisible on my front page. Under Settings, it displays, but in the old smaller size.

Windows 10, behavior the same under all of Edge, Firefox and Chrome.
Last edited by Cain EL v1 on Wed Oct 13, 2021 3:13 pm, edited 1 time in total.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Oct 13, 2021 5:00 pm

Cain EL v1 wrote:This nation's flag, the flag of Sweden, seems to be invisible on my front page. Under Settings, it displays, but in the old smaller size.

Windows 10, behavior the same under all of Edge, Firefox and Chrome.

This should be fixed now. That particular image had no default size, so could be displayed at size 0x0.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Oct 13, 2021 5:02 pm

Durm wrote:When you haven't chosen a flag yet, the nation creation page shows the default flag like it always has done, but the selection thing says Aaland Islands. When you create a nation without choosing a flag, it has the Aaland Islands flag.

Great catch. Now fixed, thanks.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Oct 13, 2021 5:07 pm

Merni wrote:On "Antiquity" theme, nations pages for nations with SVG flags show massive flag images that take up the entire page width or more.

Ah, I always forget about poor Antiquity theme. Should be fixed now, thanks.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Oct 13, 2021 5:08 pm

Broceliande wrote:Just yesterday, my Flag suddenly became huge and fills up the whole page, requiring to scroll down most of a page to get to the content on the main page.

WTF? Is there a way I can manage this appearance?
Was there some site change, or is this some kind of error or glitch?
I use one of the default supplied flags, btw.

I'm going to assume this was an Antiquity theme bug; if not, please specify your browser+device+theme.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Oct 13, 2021 5:10 pm

Republic Of Ludwigsburg wrote:Pretty buggy, changes the ratio of the flag, makes it buggy in the activity page, and the preview in the "create your own flag" page is broken.

Sadly I'm unable to reproduce any of these issues. Please supply more detail / examples, as it's difficult to know what you mean by "buggy" and "broken." If it happens with particular images, please upload a copy of that image somewhere. Please also supply your browser+device+theme.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Oct 13, 2021 5:15 pm

Refuge Isle wrote:as well as a given page's no-template pages. I presume this is undesired operation.

When you request a page with "no-template", you're asking for content with no styling at all. The default size of SVG images can be huge, so that's what you get. "no-template" is generally intended for consumption by bots -- it wouldn't make sense to start styling it to make it more pleasant for humans, since that's what all the other themes are for.

User avatar
Courelli
Attaché
 
Posts: 82
Founded: Apr 17, 2017
Left-Leaning College State

Postby Courelli » Wed Oct 13, 2021 5:16 pm

My SVG flag, on this nation, doesn't show up at all in the title/name header on my nation page. However, it displays elsewhere.

Edit: I'm using Google Chrome on a Dell laptop, if that makes a difference, and I created the SVG mere minutes ago in Adobe Illustrator.
Last edited by Courelli on Wed Oct 13, 2021 5:21 pm, edited 2 times in total.
Governor: Paolo Argentieri
Prime Minister: Elisabetta Di Martino
FA Minister: Emiliano Marsicano
WA Representative: Alessandra Borgese
THE REPUBLIC OF COURELLI
Pronouns: he/him
Discord: @courelli

recall how often in human history the saint and the rebel have been the same person

12th, 15th, 18th, & 23rd Delegate of The Social Liberal Union | Administrator of NSLeft | Co-Author of GA #459 | Co-Author of Issue 1558

Anaaxes wrote:imagine explaining to an alien child the concept of a birthday party fully hosted by Chuck E. Cheese himself, they would be mortified of our rituals

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Oct 13, 2021 5:29 pm

SherpDaWerp wrote:I've no idea how I'd implement it; I've never played with SVG before. My question was moreso testing the waters so I don't go down a rabbit-hole of making, say, a JS-animated flag only to find out that no JS works.

I did a quick test of a few different methods, and I don't think any of them will work, because our SVG sanitizer can't confidently assess them. I tried script tags, style tags with @keyframes, and the animate tag.

User avatar
Erynia and Draconia
Spokesperson
 
Posts: 103
Founded: Nov 09, 2017
Left-wing Utopia

Postby Erynia and Draconia » Wed Oct 13, 2021 5:34 pm

My SVG flag shows up way too big and on the NS stat trends the flag is extremely big (as some people have already said).
he/they
About me and my nation
Former Delegate of The Social Liberal Union
Author of Issue No. 1510 and 1558

Next

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Aelyria, Anjan Kloss, K7 Asteroid, La Sangre subio, Morgundy, North American Imperial State, Prussia Republican Kingdom, Zasmatu

Advertisement

Remove ads