Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: jpeg_quality

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
65      imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );
66
67      imagedestroy( $src ); // Free up memory
68
69      if ( ! $dst_file )
70           $dst_file = str_replace( basename( $src_file ), 'cropped-' . basename( $src_file ), $src_file );
71
72      $dst_file = preg_replace( '/\\.[^\\.]+$/', '.jpg', $dst_file );
73
74      if ( imagejpeg( $dst, $dst_file, apply_filters( 'jpeg_quality', 90, 'wp_crop_image' ) ) )
75           return $dst_file;
76      else
77           return false;
78 }
79
80 /**
81  * Generate post thumbnail attachment meta data.
82  *
83  * @since 2.1.0