Skip to content
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

Document existing system for logos images in taxonomies and design new system #7447

Open
Tracked by #5559
stephanegigandet opened this issue Oct 6, 2022 · 6 comments
Labels
📚 Documentation Documentation issues improve the project for everyone. ✨ Feature Features or enhancements to Open Food Facts server Fixed ? This issue might have been fixed. We can close them once we verify that they have. labels logos ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Oct 6, 2022

Problem description

Some taxonomy entries (in particular labels) have associated logo images that we display on the website. How to add those images is not obvious:

  • images must be SVG or PNG
  • the height of the image must be 90 pixels (because on the website we display them at 90 pixels height)
  • the filename must end with [width]x90.[svg|png] to indicate the width of the image when the height is 90 pixels (this is to be able to specify the width of the image in HTML)
  • the filename must be the canonical name of the entry in a specific language (e.g. fr:ab-agriculture-biologique -> ab-agriculture-biologique.74x90.png)
  • the file must be located in a specific path: html/images/lang/fr/labels/ab-agriculture-biologique.74x90.png

It is possible to have different images for different languages.

Desired solution

We may want to define a better solution to handle taxonomy images. We probably need in particular to get a fresh look at the requirements, beyond just displaying the logos in the website.

It could be useful to keep high resolution images (for PNG), and have an automated process to scale them / rename them into smaller images.

Part of

@stephanegigandet stephanegigandet added ✨ Feature Features or enhancements to Open Food Facts server 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies logos labels Oct 6, 2022
@alexgarel
Copy link
Member

I would say, have the file name in the taxonomy, it would be some kind of self documentation.

For size, maybe add a check in the CI ?

@aleene
Copy link
Contributor

aleene commented Oct 6, 2022

Also these images should percolate to Robotoff.

@teolemon teolemon added the 📚 Documentation Documentation issues improve the project for everyone. label Oct 10, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jan 9, 2023
@Roxie-32 Roxie-32 added the Fixed ? This issue might have been fixed. We can close them once we verify that they have. label Feb 9, 2023
@teolemon teolemon added the labels label Jun 8, 2023
@nicorikken
Copy link

nicorikken commented Mar 24, 2024

@stephanegigandet can you explain what the plan is for svg file resolution? Adding size numbers in the filename of a SVG doesn't make sense to me. Does an existing SVG have to be converted to adjust the resolution, or is it enough to take into account the aspect ratio and fix the smallest side to 90px to come up with the other dimension?

Also, what other files would have to be added/changed? I did notice links in https://github.com/openfoodfacts/openfoodfacts-server/blob/main/taxonomies/labels.txt and https://github.com/openfoodfacts/robotoff/blob/main/data/label_logos.json (only after publication)

@stephanegigandet
Copy link
Contributor Author

@stephanegigandet can you explain what the plan is for svg file resolution? Adding size numbers in the filename of a SVG doesn't make sense to me. Does an existing SVG have to be converted to adjust the resolution, or is it enough to take into account the aspect ratio and fix the smallest side to 90px to come up with the other dimension?

It's enough to fix the height to 90px to get the width to put in the filename, the SVG files don't have to be changed. This is so that we can get the aspect ratio from the filename only, without having to parse the SVG.

Also, what other files would have to be added/changed? I did notice links in https://github.com/openfoodfacts/openfoodfacts-server/blob/main/taxonomies/labels.txt and

Those links are currently not used.

https://github.com/openfoodfacts/robotoff/blob/main/data/label_logos.json (only after publication)

Those I don't know, @raphael0202 ?

@raphael0202
Copy link
Contributor

Those I don't know, @raphael0202 ?

label_logos.json was created in the absence of a clear way to know which label has a logo. It's used to display the logo in Hunger Games.
I would be happy to switch to a more centralized system if it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 Documentation Documentation issues improve the project for everyone. ✨ Feature Features or enhancements to Open Food Facts server Fixed ? This issue might have been fixed. We can close them once we verify that they have. labels logos ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies
Projects
Status: Ready for Dev
Status: Todo
Development

No branches or pull requests

7 participants