openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
GNU Affero General Public License v3.0
632 stars 370 forks source link

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

Open stephanegigandet opened 1 year ago

stephanegigandet commented 1 year ago

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:

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

alexgarel commented 1 year ago

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 commented 1 year ago

Also these images should percolate to Robotoff.

github-actions[bot] commented 1 year ago

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

nicorikken commented 5 months ago

@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 commented 5 months ago

@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 commented 4 months ago

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.