Blow out mem limit, slightly larger thumbnails.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a39ee17da9
commit
3b82a74e29
|
@ -40,7 +40,7 @@ function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
|
|||
imagesavealpha( $thumbnail, true);
|
||||
}
|
||||
|
||||
@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $sourceImageWidth, $sourceImageHeight );
|
||||
imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $sourceImageWidth, $sourceImageHeight );
|
||||
|
||||
imagedestroy( $image ); // Free up memory
|
||||
|
||||
|
@ -153,9 +153,8 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
|||
$max = apply_filters( 'wp_thumbnail_creation_size_limit', absint( WP_MEMORY_LIMIT ) * 1024 * 1024, $attachment_id, $file );
|
||||
|
||||
if ( $max < 0 || $metadata['width'] * $metadata['height'] < $max ) {
|
||||
$max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file );
|
||||
$max_side = apply_filters( 'wp_thumbnail_max_side_length', 140, $attachment_id, $file );
|
||||
$thumb = wp_create_thumbnail( $file, $max_side );
|
||||
|
||||
if ( @file_exists($thumb) )
|
||||
$metadata['thumb'] = basename($thumb);
|
||||
}
|
||||
|
@ -188,7 +187,9 @@ function wp_load_image( $file ) {
|
|||
if ( ! function_exists('imagecreatefromstring') )
|
||||
return __('The GD image library is not installed.');
|
||||
|
||||
$image = @imagecreatefromstring( @file_get_contents( $file ) );
|
||||
// Set artificially high because GD uses uncompressed images in memory
|
||||
@ini_set('memory_limit', '256M');
|
||||
$image = imagecreatefromstring( file_get_contents( $file ) );
|
||||
|
||||
if ( !is_resource( $image ) )
|
||||
return sprintf(__("File '%s' is not an image."), $file);
|
||||
|
|
|
@ -1070,7 +1070,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL )
|
|||
|
||||
// separate the filename into a name and extension
|
||||
$info = pathinfo($filename);
|
||||
$ext = strtolower( $info['extension'] );
|
||||
$ext = $info['extension'];
|
||||
$name = basename($filename, ".{$ext}");
|
||||
|
||||
// Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
|
||||
|
@ -1083,7 +1083,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL )
|
|||
if ( empty( $ext) )
|
||||
$ext = '';
|
||||
else
|
||||
$ext = ".$ext";
|
||||
$ext = strtolower( ".$ext" );
|
||||
$filename = $filename . $ext;
|
||||
while ( file_exists( $dir . "/$filename" ) ) {
|
||||
if ( '' == "$number$ext" )
|
||||
|
|
|
@ -146,8 +146,6 @@ function gallery_shortcode($attr) {
|
|||
$output = "
|
||||
<style type='text/css'>
|
||||
.gallery {
|
||||
width: 450px;
|
||||
left: 50%;
|
||||
margin: auto;
|
||||
}
|
||||
.gallery div {
|
||||
|
@ -156,7 +154,7 @@ function gallery_shortcode($attr) {
|
|||
text-align: center;
|
||||
width: 33%; }
|
||||
.gallery img {
|
||||
border: 3px solid #cfcfcf;
|
||||
border: 2px solid #cfcfcf;
|
||||
}
|
||||
</style>
|
||||
<div class='gallery'>
|
||||
|
|
Loading…
Reference in New Issue