• Recently I noticed an incredible amount of 0 byte image thumbnails in wp-content/uploads. I then figured out what was creating these files, which is this plugin.

    This code registers the following custom thumbnail sizes:

    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('mobile-320', 320, 99999);
    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('mobile-640', 640, 99999);
    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('mobile-360', 360, 99999);
    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('mobile-720', 720, 99999);
    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('mobile-1080', 1080, 99999);
    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('tablet-768', 768, 99999);
    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('tablet-800', 800, 99999);
    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('tablet-1024', 1024, 99999);
    plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php:            add_image_size('tablet-1280', 1280, 99999);

    What I’m trying to understand is why is there a need to have thumbnail sizes with these dimensions and how can I stop PageSpeed Ninja from creating them? Is there an option I can turn off or do I need remove the custom thumbnails using a filter?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Denis Ryabov

    (@dryabov)

    One of PageSpeed Ninja’s features is rescaling of large images for mobile devices with smaller screen resolutions. PSN is able to do it on the fly, but to improve performance we added a code that creates smaller images automatically for most common screen widths via built-in WordPress feature to create thumbnails. I’ll try to fix it in the next release (thumbnails will be created if rescaling of large images is enabled only). You can remove creation of that thumbnails using remove_image_size function, but most likely it’s simpler to remove $this->add_image_sizes(); from wp-content/plugins/psn-pagespeed-ninja/includes/class-pagespeedninja.php and wait for next release.

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin is creating 0 byte sized image thumbnails’ is closed to new replies.