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

  1. Prepare new images in PNG and SVG formats
  2. Review both versions of the image
  3. Consider whether to switch the image to a SVG, for consistency with modules, smaller file size, and greater scalability
  4. Replace current image with chosen one
  5. If switching format, update image path in plugin
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lostcarpark created an issue. See original summary.

lostcarpark’s picture

StatusFileSize
new8.99 KB
new4.8 KB

I 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.

Recipe logo

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.

lostcarpark’s picture

StatusFileSize
new2.44 KB

I've done some optimisation of the SVG file, and got it down to 2.5KB.

bhumikavarshney’s picture

Status: Active » Needs review
StatusFileSize
new18.36 KB

Hi
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

chrisfromredfin’s picture

I 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?

jatingupta40 made their first commit to this issue’s fork.

jatingupta40’s picture

Resolved 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...

chrisfromredfin’s picture

Status: Needs review » Fixed

OK, 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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.