NATION

PASSWORD

SVG nation flags

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.

Advertisement

Remove ads

User avatar
Republic Of Ludwigsburg
Spokesperson
 
Posts: 138
Founded: Jun 26, 2021
Democratic Socialists

Postby Republic Of Ludwigsburg » Wed Oct 13, 2021 11:20 pm

[violet] wrote:
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.

Browser: Mozilla Firefox
Device: HP Laptop with Intel I5 and Windows 10
Theme: Liberal

Basically, it doesn't show the preview properly. I tried converting the same flag I have right now to .SVG and it created this abomination.
Image


It also reproduces this image in the nation page:
Image

It seems the activity page bug is "fixed".

These issues probably happen because the code is used to only 2:3 flags not 2:4 like my flag.
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
Vyharka
Political Columnist
 
Posts: 2
Founded: Feb 22, 2020
Psychotic Dictatorship

Postby Vyharka » Thu Oct 14, 2021 1:18 am

[violet] wrote:Yes, as I'm sure you're aware, the more complicated the image, the more the SVG size starts to blow out, until you reach a point where PNG makes more sense. Flags get used all over the place on NationStates, often in tiny sizes, so it's important to keep filesize low.

Yeah. And why this one looks like right proper shite at forum size as an SVG. xD

Regardless: neat addition.
DOMINIONWITHOUTEND

User avatar
Tinhampton
Powerbroker
 
Posts: 9182
Founded: Oct 05, 2016
Anarchy

Postby Tinhampton » Thu Oct 14, 2021 2:38 am

[violet] wrote:
Diarcesia wrote:I've already resized the entire thing to be one pixel high, and the message shows "We attempted to resize and compress your flag, but it was still too large. If possible, please try uploading a smaller or less detailed version."? The filesize is 36kb

In the case of SVG images, this error message refers to the filesize, which is capped at 12kb for SVG (after compression). That's a pretty low ceiling, and it may be raised after further testing.

The description at the top of the Create a National Flag page neither reflects the fact that you can now upload an SVG flag nor that such a flag can be no larger than 12kb.
The Self-Administrative City of TINHAMPTON (pop. 319,372): Saffron Howard, Mayor (UCP); Alexander Smith, WA Delegate-Ambassador

Authorships & co-authorships: SC#250, SC#251, Issue #1115, SC#267, GA#484, GA#491, GA#533, GA#540, GA#549, SC#356, GA#559, GA#562, GA#567, GA#578
Other achievements: Cup of Harmony 73 champions; Philosopher-Queen of Sophia; possibly very controversial; "Tinhampton? the man's literally god"
Who am I, really? 45yo Tory woman w/Asperger's; Cambridge graduate; currently reading nothing of any significance

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

Postby Valentine Z » Thu Oct 14, 2021 6:51 am

I got an early bird special with my flag. That is, it is 58.7 KB huge.

Nope, never mind. It was shrunk down now. But I was able to upload that 58.7 KB file, now I can't. :P
Last edited by Valentine Z on Thu Oct 14, 2021 6:57 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
Disgraces
Diplomat
 
Posts: 883
Founded: Apr 07, 2020
Moralistic Democracy

Postby Disgraces » Thu Oct 14, 2021 8:12 am

I like more this stats screen that doesn't show the flag so it doesn't cover the latest updates

User avatar
Neo Mida Gals
Lobbyist
 
Posts: 17
Founded: Oct 08, 2021
Inoffensive Centrist Democracy

Postby Neo Mida Gals » Thu Oct 14, 2021 8:17 am

I dont know how put Image of trend,but when I click my flag doesnt appear.
I tried with my puppets and the same happend,Is this a bug or Is part of the update?
Last edited by Neo Mida Gals on Thu Oct 14, 2021 8:21 am, edited 1 time in total.

User avatar
Neo Mida Gals
Lobbyist
 
Posts: 17
Founded: Oct 08, 2021
Inoffensive Centrist Democracy

Postby Neo Mida Gals » Thu Oct 14, 2021 8:20 am

Neo Mida Gals wrote:I dont know how put Image of trend,but when I click my flag doesnt appear.
I tried with my puppets and the same happend,Is this a bug or Is part of the update?

Instead of this only my name appears.
Last edited by Neo Mida Gals on Thu Oct 14, 2021 8:21 am, edited 1 time in total.

User avatar
Disgraces
Diplomat
 
Posts: 883
Founded: Apr 07, 2020
Moralistic Democracy

Postby Disgraces » Thu Oct 14, 2021 8:31 am

Neo Mida Gals wrote:
Neo Mida Gals wrote:I dont know how put Image of trend,but when I click my flag doesnt appear.
I tried with my puppets and the same happend,Is this a bug or Is part of the update?

Instead of this only my name appears.

This is what I meant

User avatar
Neo Mida Gals
Lobbyist
 
Posts: 17
Founded: Oct 08, 2021
Inoffensive Centrist Democracy

Postby Neo Mida Gals » Thu Oct 14, 2021 8:37 am

Disgraces wrote:
Neo Mida Gals wrote:Instead of this only my name appears.

This is what I meant

Strange,I expect [Violet] Resolve this.

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

Postby Merni » Thu Oct 14, 2021 8:55 am

Neo Mida Gals wrote:
Disgraces wrote:This is what I meant

Strange,I expect [Violet] Resolve this.
They did it on purpose:
[violet] wrote:
Valentine Z wrote: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.

This is now fixed, in the sense that flag images on Trend charts have been replaced with text labels.
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
Disgraces
Diplomat
 
Posts: 883
Founded: Apr 07, 2020
Moralistic Democracy

Postby Disgraces » Thu Oct 14, 2021 9:20 am

Merni wrote:
Neo Mida Gals wrote:Strange,I expect [Violet] Resolve this.
They did it on purpose:
[violet] wrote:This is now fixed, in the sense that flag images on Trend charts have been replaced with text labels.

I hope it stays like this

User avatar
[violet]
Site Admin
 
Posts: 15267
Founded: Antiquity

Postby [violet] » Thu Oct 14, 2021 12:51 pm

Vincent Drake wrote:A minimal template would be greatly appreciated, even for non R/D players. If you've ever tried to check NS stuff on mobile in areas with shaky cell service, you know the pain of the site hanging on images/graphics and failing to load. Same thing happens on laptops/desktops with shaky wifi. It would be a win-win-win situation - users have a fast way to view the site, the site doesn't need to serve resources to users who actively don't want to see them, and script authors get a more consistent CSS environment (styling no-template and template pages in the same script is truly a mess). Some actions like endorsing force a template page even if the user started on no-template and the transitions are jarring. They are really jarring for me, with an incomplete dark mode, I get flashing dark and light pages which can't be good for my eyes and can't complete it with the way template pages are currently.

Would you mind starting a new Technical thread for this? There's a lot of work through there.

User avatar
[violet]
Site Admin
 
Posts: 15267
Founded: Antiquity

Postby [violet] » Thu Oct 14, 2021 12:59 pm

Republic Of Ludwigsburg wrote:
[violet] wrote: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.

Browser: Mozilla Firefox
Device: HP Laptop with Intel I5 and Windows 10
Theme: Liberal

Basically, it doesn't show the preview properly. I tried converting the same flag I have right now to .SVG and it created this abomination.

Thanks for the new info. Unfortunately I still can't reproduce those issues on Firefox with Liberal theme. Which version of Firefox do you use (menu -> Help -> About Firefox)... is it up to date? And do you use any browser plugins or custom styling that might be interfering with the display? Also please upload a copy of the SVG image somewhere -- currently you have a PNG flag, so I can't investigate whether there's any issue with that particular image.

User avatar
Great Algerstonia
Ambassador
 
Posts: 1807
Founded: Mar 21, 2019
Inoffensive Centrist Democracy

Postby Great Algerstonia » Thu Oct 14, 2021 6:13 pm

Damn, the new real world flags look pretty sleek compared to the old ones.
Can't get off r/politicalcompassmemes, supporter of the Texas Enabling Act of 1933, part of the People's Gestapo
The Kingdom Of The Three Isles wrote:
New haven america wrote:Your sarcasm detector's broken.

My what now?

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

Postby SherpDaWerp » Thu Oct 14, 2021 6:28 pm

[violet] wrote:
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.

Well that's certainly above and beyond what I expected; thanks [v]! Shame it doesn't work, but that's fine. I would have thought it would be pretty easy to confidently assess CSS, but I guess there's better things to do than re-make a sanitiser if it already does the job.

User avatar
Betelgeuse Alliance
Attaché
 
Posts: 84
Founded: Oct 19, 2018
Anarchy

Postby Betelgeuse Alliance » Thu Oct 14, 2021 6:52 pm

It's very nice that SVG support is being worked on. I just remade my flag in SVG and tried to upload it, but as I've read from this thread, I'm not the only one who gets an error saying ''We attempted to resize and compress your flag, but it was still too large. If possible, please try uploading a smaller or less detailed version.'' I refreshed my flag in PNG for the time being.

I've also read that there's a 12 kB ceiling for SVG filesize as of now, though I'm not sure if that means you can currently only upload a file that's 12 kB max, or if you can upload a file that's any size after which it gets compressed to 12 kB or under (I think I kind of read that from this thread, but there's a high chance I'm wrong). If it is the latter of the two, then I wonder if that means that it tried to compress my 32 kB SVG to 12 kB or under, but failed to do so and was therefore only able to get it to something above 12 kB (can't know for sure as of the time I'm typing this, given that I'm a total noob when it comes to this).

And perhaps a weird question, but the program I use to make SVG's (which I literally installed yesterday right after I read this thread, lol) also allows me to export to .svgz, which apparently is some kind of compressed SVG file. However, both browsers I tried (Chrome and Edge) don't seem to support .svgz properly since both threw the same encoding error when trying to open it. I'm assuming this means that NationStates can't show them either, right?

That's all. (I didn't really feel like quoting others because I felt kinda lazy to be honest :oops:)

EDIT: Quickly wanted to add that when I was on the upload page and chose my SVG file, the preview worked flawlessly. Don't know if that's relevant info, but I wanted to point this out in case it is.
Last edited by Betelgeuse Alliance on Thu Oct 14, 2021 7:04 pm, edited 1 time in total.
A neutral intergalactic alliance aiming to protect its own peace and liberty, NOT an empire!

I only use NS Stats very loosely - I mainly use factbooks - TG's welcome

_______________''United to protect our peace and liberty!''_______________
SapplyValues Compass:
Link to my results page

For and Against (note that these are just my own opinions, I'm not hostile towards other's views):
FOR: Georgism, UBI, Libertarianism, Free-Market Capitalism, Environmentalism, Guaranteed Healthcare & Education, LGBT+ Equal Rights, Free Speech, Local Democracy, Advancement, Diplomacy
AGAINST: Socialism, Communism, Cronyism, Crony Capitalism, Political Correctness, Radical Feminism, Excessive Government Interference, Authoritarian Left & Right, Corruption

User avatar
[violet]
Site Admin
 
Posts: 15267
Founded: Antiquity

Postby [violet] » Thu Oct 14, 2021 6:53 pm

SherpDaWerp wrote:Well that's certainly above and beyond what I expected; thanks [v]! Shame it doesn't work, but that's fine. I would have thought it would be pretty easy to confidently assess CSS, but I guess there's better things to do than re-make a sanitiser if it already does the job.

Yeah, because it's a security thing, we really need to use a tried & tested library, rather than rely on anything I pull together in between Squid Game episodes.

User avatar
[violet]
Site Admin
 
Posts: 15267
Founded: Antiquity

Postby [violet] » Thu Oct 14, 2021 7:02 pm

Betelgeuse Alliance wrote:It's very nice that SVG support is being worked on. I just remade my flag in SVG and tried to upload it, but as I've read from this thread, I'm not the only one who gets an error saying ''We attempted to resize and compress your flag, but it was still too large. If possible, please try uploading a smaller or less detailed version.'' I refreshed my flag in PNG for the time being.

I've also read that there's a 12 kB ceiling for SVG filesize as of now, though I'm not sure if that means you can currently only upload a file that's 12 kB max, or if you can upload a file that's any size after which it gets compressed to 12 kB or under (I think I kind of read that from this thread, but there's a high chance I'm wrong). If it is the latter of the two, then I wonder if that means that it tried to compress my 32 kB SVG to 12 kB or under, but failed to do so and was therefore only able to get it to something above 12 kB (can't know for sure as of the time I'm typing this, given that I'm a total noob when it comes to this).

That's correct. We try to compress the image, and then that compressed version has to be under the limit.

I plan to double the 12kb limit pretty shortly, once I've checked out more of the SVG flags that have been uploaded so far, and then we might go higher again.

Betelgeuse Alliance wrote:And perhaps a weird question, but the program I use to make SVG's (which I literally installed yesterday right after I read this thread, lol) also allows me to export to .svgz, which apparently is some kind of compressed SVG file. However, both browsers I tried (Chrome and Edge) don't seem to support .svgz properly since both threw the same encoding error when trying to open it. I'm assuming this means that NationStates can't show them either, right?

Right, because we need to parse them to perform a security check & compression, we probably can't read that format unless I write in support for it.

I'm not sure if there's any value to an SVGZ... I assume SVGs get gzipped when transmitted from our CDN anyway. I should check that out.

User avatar
[violet]
Site Admin
 
Posts: 15267
Founded: Antiquity

Postby [violet] » Thu Oct 14, 2021 7:16 pm

SVG post-compression filesize limit has been raised from 12KB to 60KB.

I also confirmed that they're served over the network with gzip / brotli compression, when your browser supports it, so in terms of network bandwidth they arrive at somewhere around 30% of this size. So that's pretty great.

User avatar
Diarcesia
Senator
 
Posts: 4486
Founded: Aug 21, 2016
Democratic Socialists

Postby Diarcesia » Thu Oct 14, 2021 7:19 pm

Nice + 1

My SVG flag now works! Any plans on introducing ripple for the vector flags?
Last edited by Diarcesia on Thu Oct 14, 2021 7:20 pm, edited 1 time in total.

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

Postby Valentine Z » Thu Oct 14, 2021 7:19 pm

[violet] wrote:SVG post-compression filesize limit has been raised from 12KB to 60KB.

I also confirmed that they're served over the network with gzip / brotli compression, when your browser supports it, so in terms of network bandwidth they arrive at somewhere around 30% of this size. So that's pretty great.

Ahh, just when I'm at work, you tease! :P

I'm kidding, thanks a lot for the ceiling raised! Can't wait to try this later! ❤️
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
Courelli
Bureaucrat
 
Posts: 58
Founded: Apr 17, 2017
Left-wing Utopia

Postby Courelli » Thu Oct 14, 2021 7:53 pm

My flag doesn't show up as either a preview on the "Create a National Flag" page or on the Settings page. Could this have something to do with the SVG having a default display of 0x0 like the previous issue on the Nation page header?

I'm on Google Chrome, Windows 11 Dell laptop, SVG created in Adobe Illustrator.

EDIT for update: in the Illustrator SVG export menu, there is a "Responsive" checkbox -- checked by default, this button erases SVG intrinsic size and sets it to be rescalable by CSS, as I understand it. Unchecking this box and re-exporting the SVG solved the above issue.
Last edited by Courelli on Thu Oct 14, 2021 8:01 pm, edited 3 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] » Thu Oct 14, 2021 8:04 pm

Diarcesia wrote:Any plans on introducing ripple for the vector flags?

No ripple, sadly. AFAIK you can't merge a transparent PNG with an SVG to get another SVG.

User avatar
[violet]
Site Admin
 
Posts: 15267
Founded: Antiquity

Postby [violet] » Thu Oct 14, 2021 8:07 pm

Courelli wrote:My flag doesn't show up as either a preview on the "Create a National Flag" page or on the Settings page. Could this have something to do with the SVG having a default display of 0x0 like the previous issue on the Nation page header?

Very likely, yes. Can you please upload an image that triggers this problem? As your current flag is a version you made that works.

User avatar
Diarcesia
Senator
 
Posts: 4486
Founded: Aug 21, 2016
Democratic Socialists

Postby Diarcesia » Thu Oct 14, 2021 8:12 pm

[violet] wrote:
Diarcesia wrote:Any plans on introducing ripple for the vector flags?

No ripple, sadly. AFAIK you can't merge a transparent PNG with an SVG to get another SVG.

Although theoretically, if we somehow convert the NS ripple PNG to an SVG overlay, would the feature be possible?

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Sierra Lyricalia

Advertisement

Remove ads