WIP: Image size selector missing custom sizes

Browser: Any
OS: Every one

Hullo.

Can’t try this in the sandbox… no custom theme there :stuck_out_tongue:

I was working on the template of a single post and wanted to use a custom image size for the thumbnail, so i added it using add_image_size in my custom child theme.

Apparently, if:

  • you are working on the template while a specific post is selected for preview
    AND
  • that post thumbnail list hasn’t been flushed yet (wanted to test some sizes before rebuilding)
    THEN
  • the image size selector won’t display missing sizes for the image

Sizes will normally appear unselecting the post in the template preview

Hi,
Thanks so much for your report!

Is it possible that the image already existed before you created the new image sizes?
If so this is expected. The Image size selector is based on the selected attachment’s generated image metadata, so a newly registered custom size will not appear for an existing thumbnail until that image has been regenerated for the new size.

I haven’t used it in a long time, but this was always my go-to:

If the custom size is still missing after regeneration, send the exact add_image_size() snippet.

Best regards,
timmse

This is exactly the case, as I wrote in the opener. And that’s my plugin of choice when rebuilding thumbnails size.

The point is I was working on the single post template, and that bamboozled me for a while. I had the size appearing in the images when in the page builder when working on loop items, but not in the single post.

The fact the image size could not be selected just because post selected for the preview did not happen to have that thumb size is not ok. IMHO all available sizes should appear at any time, and if the size is missing it should fallback to fullsize… at least when working on templates.

Thanks for the follow-up.

We added this to our internal tracker as an improvement: the image size selector should show all registered site image sizes, and if a selected size is not available for the specific image, Bricks should fall back to the full-size image instead.

1 Like