Automattic / regenerate-thumbnails

WordPress plugin for regenerating thumbnails of uploaded images. Over 1 million active users and counting.
https://alex.blog/wordpress-plugins/regenerate-thumbnails/
GNU General Public License v2.0
133 stars 54 forks source link

Don't attempt to regenerate SVGs #111

Closed donnapep closed 3 years ago

donnapep commented 3 years ago

Depending on settings, SVG files were being deleted when thumbnails were regenerated.

Steps to Reproduce

  1. Install the "SVG Support" plugin.
  2. Upload some SVG files as well as other image files to the media library.
  3. Add the following to theme's functions.php - add_image_size( 'test-only', 666, 666, ['center', 'center'] );
  4. In Tools > Regenerate Thumbnails, uncheck both checkboxes and regenerate thumbnails. Depending on the dimensions of the images that were uploaded, new thumbnails should be generated for each non-SVG image that are roughly 666x666.
  5. Comment out the code added in step 3.
  6. In Tools > Regenerate Thumbnails, uncheck the Skip checkbox and check the Delete checkbox. Regenerate thumbnails.
  7. Ensure the new thumbnails that were generated in step 4 are deleted, but that the SVGs are not.

Reported at https://wordpress.org/support/topic/all-svg-files-were-removed-after-plugin-work/.