Archived topic
Uploading site logo creates proliferation of cropped files
20 replies · Started by NBC on October 30, 2017
When I upload my site logo within the Customizer, the process creates the following files:
cropped-index-32x32.png
cropped-index.png
cropped-index-145x145.png
cropped-index-180x180.png
cropped-index-192x192.png
cropped-index-270x270.png
cropped-index-300x300.png
index-145x145.png
index-300x300.png
index.png [the actual upload]
Annoyingly enough, cropped-index.png and index.png are exactly the same size (512 pixels square).
Why in the dickens does the process use cropped-index.png instead of index.png? Why does it need to add "cropped-" on the beginning of the file names? They're not cropped, just downsized! Talk about bloat: Every time the site code references the index file, the length of the name adds a boatload of useless bytes.
Any way to clean this up? I understand the thumbnail generation process that produces these two files
index-145x145.png
index-300x300.png
but why can't it just use the index.png file I uploaded and skip the "cropped-" designations on the smaller sizes it creates?
Thanks for any insights!
That's strange - maybe you have a plugin installed which is registering a bunch of sizes? If image sizes are registered in WordPress, they will be generated on every single image upload.
My problem isn't so much with the thumbnail sizes as it is with the idea that the system creates a "cropped" version of the index file that's exactly the same size as the original upload and uses the "cropped" version.
WP creates up to 3 thumbnail sizes for every upload, but my problem is the cropped stuff.
Definitely weird - never seen it before. My first guess is a plugin you have installed.
It could be the system GPP uses to crop images, but you've have to have the image size set in Customize > Blog > Featured Images. We've changed to a more modern image resizing script in GPP 1.5, which is due for release this week.
Here's the plug-in list for the site:
All-in-One WP Migration
Async Javascript
Autoptimize
Broken Link Checker
BWS Testimonials
Contact Form 7
Duplicate Post
Easy Custom Sidebars
GP Premium
Posts in Sidebar
Regenerate Thumbnails
Rename Media Files
Theme Check
Velvet Blues Update URLs
Regenerate Thumbnails only kicks in if you activate it manually. Otherwise, it just sits there. All plug-ins are up to date.
Have you tried deactivating them to test? Hard to tell from a list of names.
Hi, Leo:
I deactivated all my plug-ins except for GPP. Same result: Cropped files appear when I replace the site logo.
So with all of them deactivated, you uploaded a new image and those files were still created?
What about if you deactivate GPP as well?
No joy. Steps as follows:
All plug-ins deactivated.
In Customizer, chose to replace the site logo.
Media library comes up. Deleted both the original and the "cropped" versions of the index file. (Verified that the files really were gone, which all of them were, including the thumbnail variants.)
Switched to upload tab. Uploaded index file.
Presto! Still getting cropped files.
Hmm, so that means it has to be your WP installation. Perhaps something server related? Really hard for me to tell unfortunately - there must be something different happening on your installation than others, as I've never seen anything like that before.
On localhost, I'm using a bog-standard install of WP. Download ZIP file from WordPress.org, place in site folder, expand. Before I ran these tests, I updated WP to 4.8.3.
The site as it exists online is an import of an All-in-One WP Migration export. The site has been updated to WP 4.8.3.
Just now, I ran the same tests on the live site. Deactivate all plug-ins, remove site logo through Customizer, remove site-logo file (and "cropped-" version) from media library, re-upload site-logo file, re-select it in the Customizer. View site and open a site-code view page. Examine name of site-logo file in site code. Same "cropped-" file names.
I have sent you the URL of the live site via e-mail message.
Any thoughts on this file-proliferation problem? I run into it repeatedly.
Unfortunately I don't really know why that's happening to your images. I've never seen WordPress created a filename-cropped.png file.
Here's my localhost using using the latest of everything: https://www.screencast.com/t/5De3dSDxp
The fact that I can't reproduce tells me there must be a function running on your site that isn't running on my site. If it's not a plugin or the theme, then perhaps it's some sort of server setting?
I know this isn't very helpful, but I'm afraid I don't have an answer. It might be worth reproducing with the Twenty Seventeen theme and no plugins, then report your findings to WordPress.org.
Be sure to mention you have no plugins and the Twenty Seventeen theme activated, or else their first reply will ask you to do that anyways.
I'll create a new test site with a new database and try the same test with 2017 and no plug-ins.
I get the same phenomenon on live sites, and that's not using my localhost installation.
Will report back as to the outcome!
Thanks again, Tom!
2017 does the exact same thing. In fact, when I add the site logo, the upload screen shows two instances of the image although I've only uploaded it once. The first is represented by an icon; the second shows a preview of my logo file. The first is cropped; the second is not. However, both files have the same pixel dimensions.
I'll delete the bitmap and redo the process, taking screen shots of each step, and post to WordPress.org about it.