NATION

PASSWORD

New custom flag auto-resizing

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

New custom flag auto-resizing

Postby [violet] » Sun Mar 06, 2011 8:21 pm

Someone test this out for me! You should now be able to upload a much larger image as a custom flag, and have the server resize it.

Don't do this on a nation that currently has a gigantic image or animated GIF because you may not be able to put it back.

User avatar
Mahaj WA Seat
Minister
 
Posts: 2091
Founded: Nov 03, 2010
Ex-Nation

Postby Mahaj WA Seat » Sun Mar 06, 2011 8:23 pm

YAY!!!!

IT WORKS!!!
Member of The South and Osiris
Representing Mahaj in the World Assembly.
The Mahaj Factbook.


Author of Missing Minors Act (Repealed) and In Regards to Cloning
Mike the Progressive wrote:
Brogavia wrote:Fuck bitches, get money.
You shall be my god.

Georgism wrote:Fuck off you cunt, I'm always nice.

NERVUN wrote:Yog zap!

Cool Egg Sandwich wrote:I am the Urinater..... I'll be back.

Jedi Utopians wrote:5) Now, saying that a nation couldn't be part of OPEC would be bold. AIPEC sounds like something you'd want to get checked out by a physician for.


User avatar
Improving Birdhouses
Civilian
 
Posts: 1
Founded: Jan 29, 2011
Ex-Nation

Postby Improving Birdhouses » Sun Mar 06, 2011 8:30 pm

Works well.

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

Postby [violet] » Sun Mar 06, 2011 8:52 pm

NOTE: Please be aware that this is an old post. It may not be accurate. Please see the Upload Flag for current information (click "More details...").


Okay, here's the skinny, since I'm not sure this will be documented anywhere else.

The server now attempts to resize flags to fit within 214x142 pixels, and generate thumbnails.

Both height and width must fit, so if your image is perfectly square, it will wind up as 142x142.

It will reformat as both PNG and JPEG and store it as whichever one is smaller (in terms of filesize).

If it can't get the image under 50KB after resizing, it will try it as a smaller size. (This is unlikely, though, because files generally aren't that large when the image is that small.)

Be aware that animated GIFs will be reformatted as static, subject to the loopholes below.

Loopholes (i.e. ways to prevent your image from being resized):

  • The 12KB Loophole: If the image you upload is under 12KB (i.e. the old limit), and its dimensions are less than 428x284, it will be left alone.
  • The Skinny 12KB Loophole: It will also be left alone if it's under 12KB and less than 107x426 (i.e. a tall skinny flag).
  • The Little Loophole: Or if it's under 50KB and already 107x71 or smaller.

Note that thumbnails are generated no matter what. If you upload an animated GIF that qualifies for a loophole above, its thumbnails (i.e. the smaller versions displayed everywhere other than the top of your nation page) will not be animated.

This doesn't affect anyone's current flag. This is only for custom flags uploaded from now on.
Last edited by [violet] on Tue Oct 22, 2013 5:33 pm, edited 3 times in total.

User avatar
Glen-Rhodes
Powerbroker
 
Posts: 9027
Founded: Jun 25, 2008
Ex-Nation

Postby Glen-Rhodes » Sun Mar 06, 2011 10:03 pm

By "thumbnails" do you mean the small flags next to nations' names? I know that I asked a while ago that those be converted into smaller images, instead of just resizing really big images with HTML/CSS. Just wondering if you remembered this suggestion!

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

Postby [violet] » Sun Mar 06, 2011 10:27 pm

Yeah, it's been on the to-do list for years. I just finally got around to doing it.

Just Guy's page taking 16 seconds to load was good motivation.

User avatar
Evil Wolf
Minister
 
Posts: 2412
Founded: Apr 28, 2005
Father Knows Best State

Postby Evil Wolf » Sun Mar 06, 2011 10:32 pm

Hmm, over 400 endorsements? Last time I saw that it was in a feeder and it was years ago. And I do recall the pages for those feeder delegates took forever to load back in the day but then again I was using dial-up at the time, so I guess I thought that it was just my crappy connection.
It's ok! You can trust me! I've been Commended!

Kryozerkia wrote:In the good old days raiding was illegal
Crazy Girl wrote:Invading was never illegal
[violet] wrote:There is supposed to be an invasion game.

Mallorea and Riva should be a Game Moderator Game Administrator.

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

Postby [violet] » Sun Mar 06, 2011 10:36 pm

Nope, my crappy coding.

User avatar
Chaotropia
Bureaucrat
 
Posts: 47
Founded: Jul 17, 2010
Ex-Nation

Postby Chaotropia » Mon Mar 07, 2011 5:48 am

I've noticed that some flags that are small and scaled up appear very small on the RMB and in the Nation's history. It also seems to affect some default flags too. I'm using the mobile nationstates.

Just Guy's page for example is about 350kb on my phone, because only some of his endorsements have become tiny flags, a lot of them are still big.
Last edited by Chaotropia on Mon Mar 07, 2011 5:53 am, edited 1 time in total.
Member of The South

User avatar
Winnipeg
Bureaucrat
 
Posts: 52
Founded: Antiquity
Ex-Nation

Postby Winnipeg » Mon Mar 07, 2011 7:20 am

That would be because most of those people haven't uploaded a new custom flag since the new tool was implemented yesterday.
Robin 'Winnipeg' Morrison
Creator of WinniVision(TM)
Home of the West Pacific

User avatar
Sunny Marionette
Ambassador
 
Posts: 1634
Founded: Feb 16, 2011
Ex-Nation

Postby Sunny Marionette » Mon Mar 07, 2011 7:22 am

You just saved me a lot of work the next time I want a new flag.
Formerly known as WWIIHG
Add 2357 to post count and three years to the age.
Religion: Zen Buddhist
Political Affiliation: None
Political Beliefs:Liberal most of the time

Nightkill the Emperor wrote:One time in India, I managed to draw an elaborate battle scene in the sand with my piss. Granted, my friends aided me in this matter, but we finished with Darth Vader force choking a random Jedi. It was one of the greatest achievements of our lives.

User avatar
The Galirandi
Attaché
 
Posts: 71
Founded: Nov 06, 2005
Ex-Nation

Postby The Galirandi » Mon Mar 07, 2011 7:45 am

Re-uploaded my stupidly large flag and it became less stupidly large. Yay. That saves me the 2 minutes or so it would have taken to resize it in Preview. :/

However,
Image
Grainy.

Is this just the fault of my graphics card or what?
Last edited by The Galirandi on Mon Mar 07, 2011 7:50 am, edited 1 time in total.

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

Postby [violet] » Mon Mar 07, 2011 2:26 pm

Yeah, that ain't right. Looking into it.

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

Postby [violet] » Mon Mar 07, 2011 2:32 pm

If you re-upload your flag, the thumbnails should now come out right.

User avatar
Flag Thief
Bureaucrat
 
Posts: 64
Founded: Jan 19, 2004
Ex-Nation

Postby Flag Thief » Mon Mar 07, 2011 3:48 pm

I just wonder if this will interefere with my ability to steal flags?

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

Postby [violet] » Mon Mar 07, 2011 4:40 pm

Ooh, yes it will! Some existing flags that are larger than the dimensions above will not be able to be reproduced exactly now. I don't think there are too many of those, but there are some. Also, while you can still steal animated GIFs, the thumbnails will not be animated.

User avatar
Hassett
Ambassador
 
Posts: 1957
Founded: Sep 11, 2009
Anarchy

Postby Hassett » Mon Mar 07, 2011 4:46 pm

I love the new 250kb limit, I'll have to re-upload some of my flags :D
Black and Yellow
Economic Left/Right: 8.38
Social Libertarian/Authoritarian: -2.82
-Former United States
-Hassett: A History through Flags

User avatar
The Merchant Republics
Powerbroker
 
Posts: 8503
Founded: Oct 25, 2010
Ex-Nation

Postby The Merchant Republics » Mon Mar 07, 2011 4:51 pm

Like a charm, which is wonderful, the method I was using to resize my flags before was... time-consuming, to say the least.
Your Resident Gentleman and Libertarian; presently living in the People's Republic of China, which is if anyone from the Party asks "The Best and Also Only China".
Christian Libertarian Autarchist: like an Anarchist but with more "Aut".
Social: Authoritarian/Libertarian (-8.55)
Economic: Left/Right (7.55)
We are the premiere of civilization, the beacon of liberty, the font of prosperity and the ever illuminating light of culture in this hellish universe.
In short: Elitist Wicked Cultured Free Market Anarchists living in a Diesel-Deco World.

Now Fearing: Mandarin Lessons from Cantonese teachers.
Factbook (FT)|Art Gallery|Embassy Program

User avatar
The Most Glorious Hack
Retired Moderator
 
Posts: 2427
Founded: Mar 11, 2003
Anarchy

Postby The Most Glorious Hack » Tue Mar 08, 2011 8:03 am

So what's the over/under on how long it'll be before some new player complains that the file size limit is too low and needs to be raised?
Now the stars they are all angled wrong,
And the sun and the moon refuse to burn.
But I remember a message,
In a demon's hand:
"Dread the passage of Jesus, for he does not return."

-Nick Cave and the Bad Seeds, "Time Jesum Transeuntum Et Non Riverentum"



User avatar
The Merchant Republics
Powerbroker
 
Posts: 8503
Founded: Oct 25, 2010
Ex-Nation

Postby The Merchant Republics » Tue Mar 08, 2011 8:07 am

The Most Glorious Hack wrote:So what's the over/under on how long it'll be before some new player complains that the file size limit is too low and needs to be raised?

We've got a couple weeks I think, at least three days give or take.
Your Resident Gentleman and Libertarian; presently living in the People's Republic of China, which is if anyone from the Party asks "The Best and Also Only China".
Christian Libertarian Autarchist: like an Anarchist but with more "Aut".
Social: Authoritarian/Libertarian (-8.55)
Economic: Left/Right (7.55)
We are the premiere of civilization, the beacon of liberty, the font of prosperity and the ever illuminating light of culture in this hellish universe.
In short: Elitist Wicked Cultured Free Market Anarchists living in a Diesel-Deco World.

Now Fearing: Mandarin Lessons from Cantonese teachers.
Factbook (FT)|Art Gallery|Embassy Program

User avatar
Syvorji
Powerbroker
 
Posts: 7996
Founded: Oct 10, 2010
Ex-Nation

Postby Syvorji » Sat Mar 12, 2011 2:08 pm

[violet] wrote:Okay, here's the skinny, since I'm not sure this will be documented anywhere else.

The server now attempts to resize flags to fit within 214x142 pixels, and generate thumbnails.

Both height and width must fit, so if your image is perfectly square, it will wind up as 142x142.

It will reformat as both PNG and JPEG and store it as whichever one is smaller (in terms of filesize).

If it can't get the image under 50KB after resizing, it will try it as a smaller size. (This is unlikely, though, because files generally aren't that large when the image is that small.)

Be aware that animated GIFs will be reformatted as static, subject to the loopholes below.

The 12KB Loophole: If the image you upload is under 12KB (i.e. the old limit), and its dimensions are less than 428x284, it will be left alone.

The Skinny 12KB Loophole: It will also be left alone if it's under 12KB and less than 107x426 (i.e. a tall skinny flag).

The Little Loophole: Or if it's already 107x71 or smaller.

Note that thumbnails are generated no matter what. If you upload an animated GIF that qualifies for a loophole above, its thumbnails (i.e. the smaller versions displayed everywhere other than the top of your nation page) will not be animated.

This doesn't affect anyone's current flag. This is only for custom flags uploaded from now on.


Including the forum avatars?

User avatar
Swkoll
Ambassador
 
Posts: 1388
Founded: Nov 19, 2009
Ex-Nation

Postby Swkoll » Sat Mar 12, 2011 2:41 pm

All hail [violet], one glitch though, my flag is really blurry...
Last edited by Great Nepal on Sun Dec 21, 2012 12:59 pm, edited 1 time in total.


Need an Ignore Cannon?
Embassy NS wiki page
Current Wars: None as of now
Member of: Nothing right now
Defcon: 1 [2] 3 4 5
6*9=42
February 17, 2011: Never Forget.
Copy and paste this into your sig if you remember the old F7.
97% of People of NS won't notice I did my math wrong, if you are the 1% who did, copy and paste this into your sig.

I lost the Game.
Zonolia wrote:You are without doubt the smartest NS player ever...
Montiar wrote:Best f*cking idea for a storefront ever.

Bluth Corporation wrote:You know, I used to be anti-Obama.

Then the anti-Obama folks opened their mouths and I listened to what they had to say.

Now I'm pro-Obama.

User avatar
Usual People In Life
Diplomat
 
Posts: 554
Founded: Jul 03, 2009
Inoffensive Centrist Democracy

Postby Usual People In Life » Sun Mar 13, 2011 7:42 am

Couldnt find this in the thread.

Am I still OK to use the same flag for all of my nations, as long as it keeps within the rules?
When is a nation not a nation? When it's a region!

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

Postby [violet] » Sun Mar 13, 2011 3:58 pm

Swkoll wrote:my flag is really blurry...

Can you post the original image you're uploading, e.g. upload it to http://imgur.com? Then I can compare and see what's happening.

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

Postby [violet] » Sun Mar 13, 2011 3:59 pm

Usual People In Life wrote:Am I still OK to use the same flag for all of my nations, as long as it keeps within the rules?

Yes, of course.

Next

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: 7 Trees, Foehn Paramilitary Regions, Gelsland, Shirahime, Soviet Federative Socialists, Unionization of European Countries

Advertisement

Remove ads