-
Notifications
You must be signed in to change notification settings - Fork 2
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
PB-302: Add icon size to metadata #81
Conversation
bd363b5
to
ce2e83f
Compare
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.
Before merging this, we should change the CI to use the new codebuild project way (so we can test it with this PR 😉 ) it is a very quick task, see PB-837 ticket. You can see this 2 recent PR were I did this work for qrcode;
- https://github.com/geoadmin/infra-terraform-github-bgdi/pull/105
- https://github.com/geoadmin/infra-terraform-bgdi-builder/pull/276
Beside that, in a separate PR we should also update python to 3.12 and all its dependencies before re-deploying service-icons (only do this if no big issues with newer version but I don't expect any) so we keep the service most up to date.
263cfba
to
47677ea
Compare
8367096
to
6472c5f
Compare
6472c5f
to
1832ea4
Compare
1832ea4
to
d0834d4
Compare
app/routes.py
Outdated
#new_size = 48 | ||
#image = image.resize((new_size[0], new_size[1])) |
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.
Those 2 lines can be deleted I guess
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.
What about for request with scale bigger than 1, the service should resize (even though currently not used).
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.
Thanks, LGTM.
Only one thing: we should have a kind of versioning in the path.
We cannot change the path of the old icon sets, for backwards compatibility.
But for the new sets, we should add a v2
or a timestamp, e.g. 2024-09 or the like to the path.
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.
Just implement the case where scale is bigger than 1.
I think this is out of scope of this PR and needs to be refined. |
2ddacb4
to
6c52f00
Compare
6c52f00
to
616f25b
Compare
app/routes.py
Outdated
new_size = int(48 * scale) | ||
if new_size != icon_set.get_default_pixel_size(): | ||
if scale != 1: | ||
new_size = int(DEFAULT_ICON_SIZE * scale) |
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.
Here you should take the size from your function not the hardcoded 48px, so the code works if we have in future non 48px icons and also if the icon are not squared:
if scale != 1:
new_size = icon.get_size().map(s => s * scale)
image = image.resize(new_size)
f2aeee8
to
5af89c1
Compare
No description provided.