Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: intermediate_image_sizes

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
100                if ( 0 === strpos($file, $uploads['basedir']) ) {// Check that the upload base exists in the file path
101                     $file = str_replace($uploads['basedir'], '', $file); // Remove upload dir from the file path
102                     $file = ltrim($file, '/');
103                }
104           }
105           $metadata['file'] = $file;
106
107           // make thumbnails and other intermediate sizes
108           $sizes = array('thumbnail', 'medium', 'large');
109           $sizes = apply_filters('intermediate_image_sizes', $sizes);
110
111           foreach ($sizes as $size) {
112                $resized = image_make_intermediate_size( $full_path_file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") );
113                if ( $resized )
114                     $metadata['sizes'][$size] = $resized;
115           }
116
117           // fetch additional metadata from exif/iptc
118           $image_meta = wp_read_image_metadata( $full_path_file );