• New test site running WP 4.8.3 under localhost (MAMP 1.9.6 with Apache 2.0.64 and PHP 5.3.5) and Mac OS X 10.5.8 Leopard.

    Bare-bones manual installation with no plug-ins. In fact, I deleted Hello Dolly and Akismet before I installed the site.

    Running the default 2017 theme. Both the 2016 and 2015 variants are present in the Themes folder.

    Media files set to store in Uploads with no year/month-specific folders.

    Actions:
    I open the Customizer and navigate to Site Identity. I add a site logo (index.png, a 512-pixel square document created in Adobe Photoshop).

    When I check the Uploads folder, I see the following files:
    cropped-index-32×32.png
    cropped-index-100×100.png
    cropped-index-150×150.png
    cropped-index-180×180.png
    cropped-index-192×192.png
    cropped-index-270×270.png
    cropped-index-300×300.png
    cropped-index.png
    index-100×100.png
    index-150×150.png
    index-300×300.png
    index.png

    The 100×100, 150×150, and 300×300 variants comply with the WP media thumbnail preferences. The other sizes match up with the requirements for various site-logo implementations. However:
    1. Why does WP create a cropped variant of index.png when I did not crop it and do not wish to do so? (The cropped variant has the same pixel dimensions as the original index.png file.)
    2. Why does WP use the cropped variant instead of index.png?

    Thank you for any insights.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Customizer creates its own image duplicate of the image, then uses cropped-x as it’s name (regardless if you actually cropped). I believe this is so admins don’t resize or delete the original X image. These cropped-x files are separate to media library, n all the sizes are for max compact favicons.

    Thread Starter bpc

    (@bpc)

    Thanks for the reply. I can’t help but see this as less-than-useful file glut. In addition, the much-longer file name adds more bytes to page code.

    Really wish this were not this way. Is there a workaround to alter the behavior?

    Any of the twentyx themes and the Customizer aren’t primarily focused on minimal code and resources- their goal is usability and maximum compatibility.

    There might be a filter that hooks into it, but if you’re after saving kbs, your best bet is to find themes that are focused on good source code and minimal footprints.

    Thread Starter bpc

    (@bpc)

    It just strikes me as an untidy way to work. “Here’s the file I want to use.” “OK, we’ll create a duplicate of it and give it a really long file name.”

    I undertook this test to see if the “cropped-” file name behavior was a WP default. I don’t actually use 201x in my own work.

    With the customizer API you could make your own input URL for the desired favicon. Then just use that instead of WP bloated default one.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding site logo creates plethora of cropped media files’ is closed to new replies.