Blow out mem limit, slightly larger thumbnails.

git-svn-id: https://develop.svn.wordpress.org/trunk@6786 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2008-02-11 09:02:44 +00:00
parent 64cfa05c2e
commit bf2d50bf6b
3 changed files with 8 additions and 9 deletions

View File

@ -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);

View 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" )

View File

@ -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'>