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
114       */
115      public function load() {
116           if ( $this->image )
117                return true;
118
119           if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) )
120                return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file );
121
122           // Even though Imagick uses less PHP memory than GD, set higher limit for users that have low PHP.ini limits
123           @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
124
125           try {
126                $this->image = new Imagick( $this->file );
127
128                if( ! $this->image->valid() )
129                     return new WP_Error( 'invalid_image', __('File is not an image.'), $this->file);
130
131                // Select the first frame to handle animated images properly
132                if ( is_callable( array( $this->image, 'setIteratorIndex' ) ) )