Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: image_memory_limit

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
3208           $file = get_attached_file( $file );
3209
3210      if ( ! is_file( $file ) )
3211           return sprintf(__('File “%s” doesn’t exist?'), $file);
3212
3213      if ( ! function_exists('imagecreatefromstring') )
3214           return __('The GD image library is not installed.');
3215
3216      // Set artificially high because GD uses uncompressed images in memory
3217      @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
3218      $image = imagecreatefromstring( file_get_contents( $file ) );
3219
3220      if ( !is_resource( $image ) )
3221           return sprintf(__('File “%s” is not an image.'), $file);
3222
3223      return $image;
3224 }
3225
3226 /**