[wp-trac] [WordPress Trac] #23292: Media uploader loads full size image and slows down, please change to thumbnails.
WordPress Trac
noreply at wordpress.org
Thu Jun 19 15:06:22 UTC 2014
#23292: Media uploader loads full size image and slows down, please change to
thumbnails.
---------------------------------+-----------------------------
Reporter: mnrtjeR | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch 4.0-early | Focuses: javascript
---------------------------------+-----------------------------
Comment (by l3rady):
We remove the medium and large image sizes as we don't use them and don't
want to waste disk and processing making those images sizes.
Because we do this we ran into this issue where the media would load all
the highres images rather than showing the thumbnail size.
Not sure why we have to show the medium size when the thumbnail size is
default 150 by 150 and the media shows the images at 120 by 120...
It would be nice just to have a filter that will allow us to see what
image size name to use as a preview in the new media manager.
For the time being we are running this code to get around the issue of not
having a medium image size:
{{{
function bfdis_alter_default_image_sizes() {
$thumbnail_dimensions = array(
'width' => (int) get_option( 'thumbnail_size_w'
),
'height' => (int) get_option( 'thumbnail_size_h'
),
'crop' => (int) get_option( 'thumbnail_crop' )
);
add_image_size(
'medium',
apply_filters( 'bfdis_medium_width',
$thumbnail_dimensions['width'] ),
apply_filters( 'bfdis_medium_height',
$thumbnail_dimensions['height'] ),
apply_filters( 'bfdis_medium_crop', (bool)
$thumbnail_dimensions['crop'] )
);
add_image_size(
'large',
apply_filters( 'bfdis_large_width',
$thumbnail_dimensions['width'] ),
apply_filters( 'bfdis_large_height',
$thumbnail_dimensions['height'] ),
apply_filters( 'bfdis_large_crop', (bool)
$thumbnail_dimensions['crop'] )
);
}
add_action( 'after_setup_theme', 'bfdis_alter_default_image_sizes'
);
}}}
This makes the medium and large image sizes the same as the thumbnail.
Because the image sizes are all the same only one size is saved to disk.
The media manager now uses the size of the image set for thumbnail.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/23292#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list