wp-cli / media-command

Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
MIT License
44 stars 41 forks source link

wp media regenerate behavior is different than plugin Regenerate Thumbnails #72

Closed instamattic closed 6 years ago

instamattic commented 6 years ago

Or maybe it's the other way around, in which case please mark this appropriately.

Anyway, when I do single (or batch) wp-cli media regenerate like so

debian@8cylinder:/var/www/html/wp$ wp media regenerate 12530

it borks my featured image thumbnails on my index page (excerpts) back to the square-ish WP default.

But when I use the WP Gui plugin Regenerate Thumbnails, Version 3.0.2 | By Alex Mills (Viper007Bond), it performs what I consider expected behavior... making the index excerpt thumbs my preferred 720x320 aspect ratio

<?php the_post_thumbnail( 'wide-n-short-featured-720' ); ?>

as I've described in wp-config.php

add_image_size( 'wide-n-short-featured-720', 720, 320, true );

Is it me?

instamattic commented 6 years ago

It is me... well most of it*.

I was ignoring output... I needed to assign a group to my user, debian. Debian did not have privs on wp-content.

sudo usermod -a -G www-data debian

*media-command's regen is still skipping some. Among those, in the CLI output, for instance:

410/1177 No "wide-n-short-featured-720" thumbnail regeneration needed for "bosch-fuel-pressure-sensor-volvo-3.2" (ID 11335).

But that image was one of several on the deeper pages like www.domain.com/page/6 and on that the CLI regen failed to act on the image. Going into the Gui to that image and using the Regenerate Thumbnails plugin, it does successfully resize the image

2017/04/bosch-fuel-pressure-sensor-volvo-3.2.jpg 800×728 pixels

http://www.instamattic.com/images/wp-regen-cli-vs-gui.png < screencaps cut n paste showing CLI vs. Gui, with the Gui showing success resizing the 720×320 image, which did fix the thumbnail display on the index page.

Thanks for contributors for this wonderful CLI software. Gratitude.

danielbachhuber commented 6 years ago

No issues then, @instamattic ?