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
Diplomat
 
Posts: 863
Founded: Jun 26, 2021
Inoffensive Centrist Democracy

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.
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
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
FACTBOOKMAINTENANCENEWSDISCORD

User avatar
Tinhampton
Postmaster-General
 
Posts: 13700
Founded: Oct 05, 2016
Civil Rights Lovefest

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. 329,537): 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, SC#374, GA#582, SC#375, GA#589, GA#590, SC#382, SC#385*, GA#597, GA#607, SC#415, GA#647, GA#656, GA#664, GA#671, GA#674, GA#675, GA#677, GA#680, Issue #1580, GA#682, GA#683, GA#684, GA#692, GA#693, GA#715
The rest of my CV: Cup of Harmony 73 champions; Philosopher-Queen of Sophia; *author of the most popular SC Res. ever; anti-NPO cabalist in good standing; 48yo Tory woman w/Asperger's; Cambridge graduate ~ currently reading The World by Simon Sebag Montefiore

User avatar
Valentine Z
Postmaster-General
 
Posts: 13018
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
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
Disgraces
Ambassador
 
Posts: 1167
Founded: Apr 07, 2020
Corporate Bordello

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
The nation that represents my views is Tidaton

User avatar
Neo Mida Gals
Attaché
 
Posts: 74
Founded: Oct 08, 2021
Ex-Nation

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
Attaché
 
Posts: 74
Founded: Oct 08, 2021
Ex-Nation

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
Ambassador
 
Posts: 1167
Founded: Apr 07, 2020
Corporate Bordello

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
The nation that represents my views is Tidaton

User avatar
Neo Mida Gals
Attaché
 
Posts: 74
Founded: Oct 08, 2021
Ex-Nation

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: 1800
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.
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
Disgraces
Ambassador
 
Posts: 1167
Founded: Apr 07, 2020
Corporate Bordello

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
The nation that represents my views is Tidaton

User avatar
[violet]
Executive Director
 
Posts: 16205
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]
Executive Director
 
Posts: 16205
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
Minister
 
Posts: 2617
Founded: Mar 21, 2019
Ex-Nation

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

Damn, the new real world flags look pretty sleek compared to the old ones.
Anti: Russia
Pro: Prussia
Resilient Acceleration wrote:After a period of letting this discussion run its course without my involvement due to sheer laziness and a new related NS project, I have returned with an answer and that answer is Israel.

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

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.
Became an editor on 18/01/23 techie on 29/01/24

Rampant statistical speculation from before then is entirely unofficial

User avatar
Betelgeuse Alliance
Attaché
 
Posts: 92
Founded: Oct 19, 2018
Ex-Nation

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.
Countless self-governing communities throughout space that are united under one constitution.

I only use NS Stats very loosely - I mainly use factbooks - Telegrams welcome

_______To protect our peace and constitutional values_______
SapplyValues Compass:
Link to my results

For and Against (just my own opinions, I'm not hostile towards other's views):
FOR: Georgism, UBI, Liberty, YIMBYism, Free Markets, Environmentalism, Guaranteed Healthcare & Education, LGBT+ Equal Rights, Free Speech, Local Democracy, Diplomacy, Technological Advancement, Open Source
AGAINST: Authoritarianism, Cronyism, Corporatism, Censorship, Radical Feminism, Corruption

User avatar
[violet]
Executive Director
 
Posts: 16205
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]
Executive Director
 
Posts: 16205
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]
Executive Director
 
Posts: 16205
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
Negotiator
 
Posts: 6784
Founded: Aug 21, 2016
Scandinavian Liberal Paradise

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: 13018
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
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
Courelli
Attaché
 
Posts: 82
Founded: Apr 17, 2017
Left-Leaning College State

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.
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] » 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]
Executive Director
 
Posts: 16205
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
Negotiator
 
Posts: 6784
Founded: Aug 21, 2016
Scandinavian Liberal Paradise

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: Ataraii, Bollocksville, Cessarea, Dazchan, MauzerX, Radicalania, Saujung Giling Manik, Second Peenadian, Skiva, Tyrnica, Victorious Decepticons

Advertisement

Remove ads