WordPress.org

Make WordPress Core

Changeset 8879


Ignore:
Timestamp:
09/13/08 18:04:20 (6 years ago)
Author:
ryan
Message:

Thumbnail and exif fixes from DD32. see #7622

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/image.php

    r8796 r8879  
    8989    $metadata = array(); 
    9090    if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) { 
    91         $imagesize = getimagesize( $file ); 
     91        $full_path_file = $file; 
     92        $imagesize = getimagesize( $full_path_file ); 
    9293        $metadata['width'] = $imagesize[0]; 
    9394        $metadata['height'] = $imagesize[1]; 
    9495        list($uwidth, $uheight) = wp_shrink_dimensions($metadata['width'], $metadata['height']); 
    9596        $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'"; 
     97         
    9698        // Make the file path relative to the upload dir 
    9799        if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) { // Get upload directory 
     
    108110 
    109111        foreach ($sizes as $size) { 
    110             $resized = image_make_intermediate_size( $file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") ); 
     112            $resized = image_make_intermediate_size( $full_path_file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") ); 
    111113            if ( $resized ) 
    112114                $metadata['sizes'][$size] = $resized; 
     
    114116 
    115117        // fetch additional metadata from exif/iptc 
    116         $image_meta = wp_read_image_metadata( $file ); 
     118        $image_meta = wp_read_image_metadata( $full_path_file ); 
    117119        if ($image_meta) 
    118120            $metadata['image_meta'] = $image_meta; 
Note: See TracChangeset for help on using the changeset viewer.