#16203 closed defect (bug) (duplicate)
Modifications of media doesn't generate alternatives added by add_image_size()
Reported by: | andreaswedberg | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0.4 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
Upload an image, then select "Edit Image".
Crop the image and Save.
Images with sizes added eith add_image_size() doesn't get alternatives generated as the standard sizes does.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Just to add more information here:
add_image_size()
only temporarily adds the image size to the$_wp_additional_image_sizes
array ( inwp-includes/media.php
).The admin panel does not use this array, and instead uses the options
"{$size}_crop"
,"{$size}_size_w"
and"{$size}_size_h"
( line 633 & 644 ofwp-admin/includes/image-edit.php
). If those options don't exist, the theme/plugin added image size will not be updated.I've worked around the issue by calling add_option() for these option names at the same time I add the image size:
I'm not sure what the repercussions would be if similar code was added to
add_image_size()
.