NATION

PASSWORD

SVG nation flags

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
[violet]
Site Admin
 
Posts: 15267
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: 10869
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
Independent & Proud.
Project: Save F7.


Photography Stuff Issues Thread 4th in Gen Sec

The Sixty! Opinions Deposit! Valentian Stories! Gwen's Adventures! Cat Anthem! Valentian News.
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 !
Q & A Here! | Heights of NS! | F7 Etiquette

Clarissa mistaken for Smurf/Avatar: 14
Valentijn Misgendered: 59
Valentijn now a She!

• Never trouble trouble until trouble troubles you.
• As a wise man once said: 我等は砲兵 皇国の護り (We are Artillery Guardians of the Empire).
• World Map is a cat playing with Australia.

User avatar
Cereskia 2
Attaché
 
Posts: 88
Founded: Jul 04, 2021
Inoffensive Centrist Democracy

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: 10869
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
Independent & Proud.
Project: Save F7.


Photography Stuff Issues Thread 4th in Gen Sec

The Sixty! Opinions Deposit! Valentian Stories! Gwen's Adventures! Cat Anthem! Valentian News.
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 !
Q & A Here! | Heights of NS! | F7 Etiquette

Clarissa mistaken for Smurf/Avatar: 14
Valentijn Misgendered: 59
Valentijn now a She!

• Never trouble trouble until trouble troubles you.
• As a wise man once said: 我等は砲兵 皇国の護り (We are Artillery Guardians of the Empire).
• World Map is a cat playing with Australia.

User avatar
SherpDaWerp
Ambassador
 
Posts: 1210
Founded: Mar 02, 2016
Civil Rights Lovefest

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.

User avatar
[violet]
Site Admin
 
Posts: 15267
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
Envoy
 
Posts: 223
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
Last edited by Allinburg on Thu Jan 1, 1970 12:00 am, edited 42 times in total. /s


currently retconningmaster dispatchooc!!
they/them, lib-left ✦ 2015-17 (totally didnt cte), 2021- ✦ i dont use ns stats
News ❑ OOC PSA: NationStates isn't regular social media, thank you.
hope u have a nice day! ⊂(・ヮ・⊂)

User avatar
SherpDaWerp
Ambassador
 
Posts: 1210
Founded: Mar 02, 2016
Civil Rights Lovefest

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.

User avatar
The Onox Legion
Lobbyist
 
Posts: 20
Founded: Sep 20, 2021
Iron Fist Consumerists

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 eastern area of Hyrule.
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

User avatar
Refuge Isle
Diplomat
 
Posts: 864
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
Spokesperson
 
Posts: 138
Founded: Jun 26, 2021
Democratic Socialists

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.
Ludwigsburger Stock
SIS (State Industrial Stock)↑2.9%
LPS (Ludwigsburg Private Stock) ↓23.1% (Socialism Bill 2021)
LWU (Ludwigsburg Worker's Union) ↑19.9%

professional idiot
Friedrich Schonbrunn says that they might institute the Habsburg monarch as a constitutional monarch on 29th September.

Politiscales: https://bit.ly/3tkNz5e

User avatar
Broceliande
Political Columnist
 
Posts: 2
Founded: Jul 11, 2014
Left-wing Utopia

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: 1629
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.
COVID19 still exists! | Donate your free time
The Labyrinth | TGW Warden | GA Committee List

OOC by default | Admins: Please allow blocking WA TGs!
E -8.0 S -3.18
Wrote 532 GA
meth
I've noticed that everybody that is for abortion has already been born. — Ronald Reagan
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
Bureaucrat
 
Posts: 57
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

User avatar
Haganham
Envoy
 
Posts: 216
Founded: Aug 17, 2021
Corrupt Dictatorship

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

Does this mean there's hope for svg support elsewhere?

User avatar
Cain EL v1
Civilian
 
Posts: 1
Founded: Jul 28, 2021
Liberal Democratic Socialists

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]
Site Admin
 
Posts: 15267
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]
Site Admin
 
Posts: 15267
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]
Site Admin
 
Posts: 15267
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]
Site Admin
 
Posts: 15267
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]
Site Admin
 
Posts: 15267
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]
Site Admin
 
Posts: 15267
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
Bureaucrat
 
Posts: 58
Founded: Apr 17, 2017
Left-wing Utopia

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.
  • Gov. Elizabeth Clarke
  • Sec. of State Charles P. Hall
  • WA Rep. Morgan O'Gallagher
THE REPUBLIC OF COURELLI
Marxist-Leninist from Alabama, USA
Turning the South really, truly red

nobilitatis virtus non stemma character

Fleet Admiral of The Red Fleet
12th, 15th, & 18th Delegate of The Social Liberal Union
Co-Author of GA#459
Koiho wrote:well,
every decision i make is motivated by aesthetic
which is both a blessing and a curse, imo
because i'm completely logically bankrupt
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
Jyskmark wrote:the world would be better if we could just use child labour

User avatar
[violet]
Site Admin
 
Posts: 15267
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
Bureaucrat
 
Posts: 62
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).
The Democratic States of Erynia and Draconia
"Pax, libyre, ed ègālya"

Overview | Political Parties | My puppets

Minister of Immigration of The Social Liberal Union
Pronouns: he/they
Pro and Anti:
For: Socialism, eco-socialism, LGBTQ+ rights, Marxism
Neutral: Social democracy
Against: Fascism, racism, homophobia, etc.; capitalism; TERFs; totalitarianism; imperialism
President: Lukas Daniels
Prime Minister: Léslye Smydt
Capital city: Erynsitte

Member of LITA

Next

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Lands of Ann

Advertisement

Remove ads