Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image-Size list shows custom image sizes twice #116

Closed
2 tasks done
grappler opened this issue Oct 31, 2019 · 1 comment · Fixed by #192
Closed
2 tasks done

Image-Size list shows custom image sizes twice #116

grappler opened this issue Oct 31, 2019 · 1 comment · Fixed by #192

Comments

@grappler
Copy link

Bug Report

Describe the current, buggy behavior

The custom image sizes are listed twice. Once with the correct information and once with the height and width missing.

+-----------------------+-------+--------+------+-------+
| name                  | width | height | crop | ratio |
+-----------------------+-------+--------+------+-------+
| full                  |       |        | N/A  | N/A   |
| large                 | 1024  | 1024   | soft | N/A   |
| medium_large          | 768   | 0      | soft | N/A   |
| medium                | 300   | 300    | soft | N/A   |
| mini-profile-thumb    | 220   | 220    | soft | N/A   |
| thumbnail             | 150   | 150    | hard | 1:1   |
| mini-navigation-thumb | 150   | 20     | soft | N/A   |
| edit-screen-thumb     | 120   | 120    | soft | N/A   |
| mini-frontpage-thumb  | 100   | 50     | soft | N/A   |
| edit-screen-thumb     | 0     | 0      | soft | N/A   |
| mini-profile-thumb    | 0     | 0      | soft | N/A   |
| mini-navigation-thumb | 0     | 0      | soft | N/A   |
| mini-frontpage-thumb  | 0     | 0      | soft | N/A   |
+-----------------------+-------+--------+------+-------+

Describe how other contributors can replicate this bug

  • Register a custom image size add_image_size( 'mini-profile-thumb', 220, 220 );
  • wp media image-size
  • See results

Describe what you would expect as the correct outcome

I expect the result to look as follows

+-----------------------+-------+--------+------+-------+
| name                  | width | height | crop | ratio |
+-----------------------+-------+--------+------+-------+
| full                  |       |        | N/A  | N/A   |
| large                 | 1024  | 1024   | soft | N/A   |
| medium_large          | 768   | 0      | soft | N/A   |
| medium                | 300   | 300    | soft | N/A   |
| mini-profile-thumb    | 220   | 220    | soft | N/A   |
| thumbnail             | 150   | 150    | hard | 1:1   |
| mini-navigation-thumb | 150   | 20     | soft | N/A   |
| edit-screen-thumb     | 120   | 120    | soft | N/A   |
| mini-frontpage-thumb  | 100   | 50     | soft | N/A   |
+-----------------------+-------+--------+------+-------+

Let us know what environment you are running this on

OS:	Linux 3.10.0-1062.4.1.el7.x86_64 #1 SMP Wed Sep 25 09:42:57 EDT 2019 x86_64
Shell:
PHP binary:	/usr/local/bin/php
PHP version:	7.1.32
php.ini used:	/usr/local/etc/php/php.ini
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/app
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:	/app/wp-cli.yml
WP-CLI version:	2.3.0
WordPress version: 5.2.4

Provide a possible solution

The code in the developer handbook is a good solution https://developer.wordpress.org/reference/functions/get_intermediate_image_sizes/#comment-730

@fliespl
Copy link

fliespl commented Sep 21, 2022

I think this is still happening on 2.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment