Does sage break add_image_size? *edit* derp: GD not installed

Just started using sage, and I’m perplexed about the fact that wp custom image resizing doesn’t seem to work (I’ve used this extensively in the past on non-roots/sage sites).

my code is:

if (function_exists('add_theme_support')) {
  add_image_size( 'medmed', 300 ); // 300 pixels wide (and unlimited height)
  add_image_size( 'homepage-thumb', 220, 180, true ); // (cropped)

which is added to my extras.php file.

The cropped/sized files that should be getting generated on upload or via the “force regenerate thumbnails” plugin are simply… not. I’m only seeing the originally uploaded files.

It’s like the resizer’s just not getting invoked for some reason when using sage.


EDIT. Derp. looks like GD isn’t running on the dev box. Reckon that’s it. Mea culpa.

You should be using the after_setup_theme hook to modify image sizes, see

Also, you should add the custom images sizes in lib/init.php:

You can also use get_intermediate_image_sizes() to make sure your custom sizes are registered

1 Like

Awesome, thanks for the point-out on that!

In the end, it was GD — I’m using a puphpet-scripted vagrant box, and previously GD was provisioned by default, but seemingly not anymore. Re-upped with GD specified explicitly, and everything works as expected :smile:

1 Like