The problem was that I read the image sizes inside the “init” hook at which point the additional sizes are not loaded yet by WordPress. I used a “later” hook now and it works.
The problem was that I read the image sizes inside the “init” hook at which point the additional sizes are not loaded yet by WordPress. I used a “later” hook now and it works.