Icon paths, naming and sizes

Created on 13 November 2019, over 4 years ago
Updated 21 September 2023, 9 months ago

Thanks so much for this great module! It's a huge help out of the box.
I've got it successfully running on a live D7 project and trying to do the same on a D8 project that I'm currently developing.
Since the D8 version is different in some ways, I hope, you can help me to solve some image-related mysteries. :-)

When I upload an image on /admin/config/pwa/settings, I see this error in the browser console:
Error while trying to use the following icon from the Manifest: http://localhost/sites/default/files/pwa/android-chrome-512x512.pngcopy2.png (Download error or resource isn't a valid image)

Here are a couple situations:
#1: The module has appended copy2.png to the original file name. It appears to be the same issue as mentioned in comment #31 of Fully working D8 version based on D7 Serviceworker β†’ . But #2 is the actual problem that breaks stuff.

#2: The full URL should be http://localhost/mysite/web/sites/default/files/pwa/android-chrome-512x512.pngcopy2.png
So, mysite/web/ is missing. The generated preview of the uploaded image on this config page is missing as well, due to the broken URL. The preview image URL in the HTML source code looks like that: <img src="/sites/default/files/pwa/android-chrome-512x512.png" width="200">.
I haven't looked at the module code but since the image URL is starting with /sites, my guess is that some sort of $base_url is missing there.

#3: The image upload field on config page /admin/config/pwa/settings expects 512x512px images.
On PWA Extra's config page /admin/config/pwa/pwa_extras it provides this uploaded image in 192x192px, though:

192x192" href="/sites/default/files/pwa/android-chrome-512x512.pngcopy.png">.
Would it make sense to either adopt the 512x512 to 192x192px or to provide a separate image upload for this 192x192px touch icon?
Is there a hook function, like in D7, for those images that I could use instead?

I'm on Drupal 8.7.9, with PHP 7.3 on the latest MAMP 5.5.

Please, let me know if I can provide more specific info to help solve the issues.

Thanks again for your valuable work! :-)

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany design.er

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • Status changed to Closed: outdated 9 months ago
  • πŸ‡©πŸ‡ͺGermany Grevil

    This should be hopefully fixed in dev now! As of πŸ› Defined App Image Icon isn't used Fixed , the uploaded images are now actually used! I think, this issue was created back when the icon upload was broken differently, meaning you could use your uploaded icons, but the uri was improperly generated.

    Now the logic is as follows:

    • You upload an icon sized 512x512
    • We create two copies and resize them to 192x192 and 144x144
    • All three files are saved as managed file entities and linked on the manifest.json
Production build 0.69.0 2024