Archived topic
Adding a custom image size
1 reply · Started by Josh on December 21, 2022
When I add a new custom image size with this code in my functions.php:
add_image_size( 'install-system', 300, 200, true);
I get a doubled version of the image size as listed by wp-cli. Why is it doubling it?
+----------------+-------+--------+------+-------+
| name | width | height | crop | ratio |
+----------------+-------+--------+------+-------+
| full | | | N/A | N/A |
| 2048x2048 | 2048 | 2048 | soft | N/A |
| 1536x1536 | 1536 | 1536 | soft | N/A |
| large | 1024 | 1024 | soft | N/A |
| medium_large | 768 | 0 | soft | N/A |
| medium | 300 | 300 | soft | N/A |
| install-system | 300 | 200 | hard | 3:2 |
| thumbnail | 150 | 150 | hard | 1:1 |
| 1536x1536 | 0 | 0 | soft | N/A |
| 2048x2048 | 0 | 0 | soft | N/A |
| install-system | 0 | 0 | soft | N/A |
+----------------+-------+--------+------+-------+
What's weird is the 2nd one is soft cropped.
When I remove the code from my functions.php both media sizes get removed in the wp-cli output.
Hi Josh,
This is controlled by WordPress. It would be best to first raise a topic here regarding this: https://wordpress.org/support/forum/wp-advanced/
