-
Notifications
You must be signed in to change notification settings - Fork 39
Try all possible logo's #1103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try all possible logo's #1103
Conversation
|
CMS used to only allow one logo file - has that changed, or is there another case you're trying to support? If there are two files, is also raises the question of why, and which one should take precedence? |
Currently my folders can have multiple files (as I download the original and change it) where some don't get picked at the moment, and if I understand the spec correctly there can be multiple logo's under But if CMS should only expose 1 logo I think this PR can be closed. |
|
I'm going to respond out of order... :)
Yes, they can be different formats and sizes. As a client that's all you can tell though, so you have to assume they're all 'the same' logo in different formats/sizes and not two or three different logos. i.e. clients normally just pick a file based on their needs, e.g. prefer svg if it exists and you need a large/detailed logo, or small png for scoreboard.
FWIW if I'm editing and have multiple files I just keep 'the best' as logo.svg or logo.png to make sure it's the one that's picked. I do this in a cms export folder, then periodically copy to cdp/contest archive and use ImageGenerator to generate all the other formats/sizes.
In the past the CMS could only store and export one file per organization. I think it sometimes does more now (?) but I've never seen a case where the one picked up by ImageGenerator wasn't the obvious correct one, e.g. the better/latest image was the only logo.*. I tried a couple times to get the CMS export to just comply with the spec and use logo.* as the filename. If they do store multiple files then I think we need to push on that more (or Nicky or I might be able to fix now) and there is a clear 'best' logo.
Yeah, that's my preference. Whoever uploads to CMS or builds a contest archive should decide which logo to use (and yes, that's also us in many cases...), then tools like IG are just processing it. |
I removed the commits this discussion was about, the 2 semi-unrelated commits have been kept. |
deboer-tim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment, but I'm fine merging as-is. Thanks. 👍🏼
| File imgFile = null; | ||
| File[] files = folder.listFiles(); | ||
| if (files == null) { | ||
| Trace.trace(Trace.ERROR, "Failed to read " + folder.getAbsolutePath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files could just mean the folder is empty and not a 'failure', message should probably be softened.
I'd probably move the 'File imgFile = null' down and just return null here, but that's just me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the variable as this is more explicit, and I prefer returning as soon as possible, only a matter of preference as there will not be many times where this folder has many files with different names.
Before the script would fail on
logo.svgand never trylogo.pngnow it should work based on preference and stop when the resized logo's are correctly created or try a logo with a low preference.