Problem/Motivation
I noticed the /images/recipe-logo.png default logo is 4167x3001 pixels, and 153KB.
Sure, it only needs to load once and will be cached by the browser, but it's taking more bandwidth to download, and more CPU cycles to rescale than needed. It's also the wrong shape.
Steps to reproduce
Open the recipes tab, and use the browser "inspect" function to verify the image size of the recipe default logo.
Proposed resolution
- Prepare new images in PNG and SVG formats
- Review both versions of the image
- Consider whether to switch the image to a SVG, for consistency with modules, smaller file size, and greater scalability
- Replace current image with chosen one
- If switching format, update image path in plugin
Comments
Comment #2
lostcarpark commentedI have uploaded PNG and SVG versions of the logo, both sized to 512x512 pixels.
Here's a preview of the PNG. I had to give the SVG a .TXT extension, so I don't think I can embed here. However they should both look the same unless you zoom in.
In terms of file size, the PNG is 9KB, while the SVG is 5KB. Both are under the Project Browser requirement of 10KB.
I would favour using the SVG since it's smaller, and we already use a SVG for the module default image.
Comment #3
lostcarpark commentedI've done some optimisation of the SVG file, and got it down to 2.5KB.
Comment #5
bhumikavarshney commentedHi
I took pull from the MR and everything is working fine
Now instead of using png you have replaced it with svg if sometime we zoom in zoom out the svg is looking perfect.
I have added screenshot of the zoomin svg
Comment #6
chrisfromredfinI believe the logo is being set by the recipe backend to be the png we don't like. So while this introduces a fallback, will the fallback be used for recipes?
https://git.drupalcode.org/project/project_browser/-/blob/2.0.x/src/Plug...
Do we need to change it there?
Comment #8
jatingupta40 commentedResolved the file conflicts.
@chrisfromredfin I believe yes we need to change it from here -
https://git.drupalcode.org/project/project_browser/-/blob/2.0.x/src/Plug...
Comment #10
chrisfromredfinOK, I was mistaken about the fallback anyway - cuz then it shows the puzzle piece and not the recipes logo. I had to add "base:" to the URI to get it to work, so we're good here. Merging to 2.0.x and forward-porting to 2.1.x