Changeset 22619
- Timestamp:
- 11/16/2012 10:02:21 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-image-editor-gd.php
r22538 r22619 26 26 27 27 /** 28 * Checks to see if current environment supports GD 28 * Checks to see if current environment supports GD. 29 29 * 30 30 * @since 3.5.0 … … 41 41 42 42 /** 43 * Loads image from $this->file into new GD Resource 44 * 45 * @since 3.5 43 * Loads image from $this->file into new GD Resource. 44 * 45 * @since 3.5.0 46 46 * @access protected 47 47 * … … 73 73 74 74 /** 75 * Sets or updates current image size 75 * Sets or updates current image size. 76 76 * 77 77 * @since 3.5.0 … … 92 92 93 93 /** 94 * Checks to see if editor supports mime-type specified94 * Checks to see if editor supports the mime-type specified. 95 95 * 96 96 * @since 3.5.0 … … 108 108 /** 109 109 * Resizes current image. 110 * Wrapper around _resize, since _resize returns a GD Resource 110 * Wraps _resize, since _resize returns a GD Resource. 111 * 112 * @since 3.5.0 113 * @access public 111 114 * 112 115 * @param int $max_w … … 153 156 * Processes current image and saves to disk 154 157 * multiple sizes from single source. 158 * 159 * @since 3.5.0 160 * @access public 155 161 * 156 162 * @param array $sizes { {width, height}, ... } … … 193 199 * @param int $dst_w Optional. The destination width. 194 200 * @param int $dst_h Optional. The destination height. 195 * @param int$src_abs Optional. If the source crop points are absolute.201 * @param boolean $src_abs Optional. If the source crop points are absolute. 196 202 * @return boolean|WP_Error 197 203 */ … … 251 257 252 258 /** 253 * Flips current image 259 * Flips current image. 260 * 261 * @since 3.5.0 262 * @access public 254 263 * 255 264 * @param boolean $horz Horizonal Flip … … 278 287 279 288 /** 280 * Saves current in-memory image to file 289 * Saves current in-memory image to file. 290 * 291 * @since 3.5.0 292 * @access public 281 293 * 282 294 * @param string $destfilename … … 336 348 337 349 /** 338 * Returns stream of current image 350 * Returns stream of current image. 351 * 352 * @since 3.5.0 353 * @access public 339 354 * 340 355 * @param string $mime_type -
trunk/wp-includes/class-wp-image-editor-imagick.php
r22581 r22619 45 45 46 46 /** 47 * Loads image from $this->file into new Imagick Object 47 * Loads image from $this->file into new Imagick Object. 48 48 * 49 49 * @since 3.5.0 … … 110 110 111 111 /** 112 * Sets or updates current image size 112 * Sets or updates current image size. 113 113 * 114 114 * @since 3.5.0 … … 139 139 140 140 /** 141 * Checks to see if editor supports mime-type specified141 * Checks to see if editor supports the mime-type specified. 142 142 * 143 143 * @since 3.5.0 … … 163 163 /** 164 164 * Resizes current image. 165 * 166 * @since 3.5.0 167 * @access public 165 168 * 166 169 * @param int $max_w … … 199 202 * Processes current image and saves to disk 200 203 * multiple sizes from single source. 204 * 205 * @since 3.5.0 206 * @access public 201 207 * 202 208 * @param array $sizes … … 247 253 * @param int $dst_w Optional. The destination width. 248 254 * @param int $dst_h Optional. The destination height. 249 * @param int$src_abs Optional. If the source crop points are absolute.255 * @param boolean $src_abs Optional. If the source crop points are absolute. 250 256 * @return boolean|WP_Error 251 257 */ 252 258 public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { 253 // Not sure this is compatible.254 259 if ( $src_abs ) { 255 260 $src_w -= $src_x; … … 303 308 304 309 /** 305 * Flips current image 306 * 307 * @since 3.5.0 308 * @access public 309 * 310 * @param boolean $horz Horizon tal Flip310 * Flips current image. 311 * 312 * @since 3.5.0 313 * @access public 314 * 315 * @param boolean $horz Horizonal Flip 311 316 * @param boolean $vert Vertical Flip 312 * @returns boolean 317 * @returns boolean|WP_Error 313 318 */ 314 319 public function flip( $horz, $vert ) { … … 327 332 328 333 /** 329 * Saves current image to file 334 * Saves current image to file. 335 * 336 * @since 3.5.0 337 * @access public 330 338 * 331 339 * @param string $destfilename … … 386 394 387 395 /** 388 * Streams current image to browser 396 * Streams current image to browser. 397 * 398 * @since 3.5.0 399 * @access public 389 400 * 390 401 * @param string $mime_type -
trunk/wp-includes/class-wp-image-editor.php
r22511 r22619 63 63 64 64 if ( ! $required_methods ) 65 $required_methods = apply_filters( 'wp_image_editor_default_methods', 66 array( 'resize', 'multi_resize', 'crop', 'rotate', 'flip', 'stream' ) ); 65 $required_methods = array(); 67 66 68 67 // Loop over each editor on each request looking for one which will serve this request's needs … … 81 80 } 82 81 83 abstract protected function load(); // returns bool|WP_Error 82 /** 83 * Loads image from $this->file into editor. 84 * 85 * @since 3.5.0 86 * @access protected 87 * @abstract 88 * 89 * @return boolean|WP_Error True if loaded; WP_Error on failure. 90 */ 91 abstract protected function load(); 92 93 /** 94 * Saves current image to file. 95 * 96 * @since 3.5.0 97 * @access public 98 * @abstract 99 * 100 * @param string $destfilename 101 * @param string $mime_type 102 * @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string} 103 */ 84 104 abstract public function save( $destfilename = null, $mime_type = null ); 85 105 86 106 /** 87 * Implement all of the below to support natively used functions: 88 * 89 * public function resize( $max_w, $max_h, $crop = false ) 90 * public function multi_resize( $sizes ) 91 * public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) 92 * public function rotate( $angle ) 93 * public function flip( $horz, $vert ) 94 * public function stream( $mime_type = null ) 95 */ 107 * Resizes current image. 108 * 109 * @since 3.5.0 110 * @access public 111 * @abstract 112 * 113 * @param int $max_w 114 * @param int $max_h 115 * @param boolean $crop 116 * @return boolean|WP_Error 117 */ 118 abstract public function resize( $max_w, $max_h, $crop = false ); 119 120 /** 121 * Processes current image and saves to disk 122 * multiple sizes from single source. 123 * 124 * @since 3.5.0 125 * @access public 126 * @abstract 127 * 128 * @param array $sizes 129 * @return array 130 */ 131 abstract public function multi_resize( $sizes ); 132 133 /** 134 * Crops Image. 135 * 136 * @since 3.5.0 137 * @access public 138 * @abstract 139 * 140 * @param string|int $src The source file or Attachment ID. 141 * @param int $src_x The start x position to crop from. 142 * @param int $src_y The start y position to crop from. 143 * @param int $src_w The width to crop. 144 * @param int $src_h The height to crop. 145 * @param int $dst_w Optional. The destination width. 146 * @param int $dst_h Optional. The destination height. 147 * @param boolean $src_abs Optional. If the source crop points are absolute. 148 * @return boolean|WP_Error 149 */ 150 abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ); 151 152 /** 153 * Rotates current image counter-clockwise by $angle. 154 * 155 * @since 3.5.0 156 * @access public 157 * @abstract 158 * 159 * @param float $angle 160 * @return boolean|WP_Error 161 */ 162 abstract public function rotate( $angle ); 163 164 /** 165 * Flips current image. 166 * 167 * @since 3.5.0 168 * @access public 169 * @abstract 170 * 171 * @param boolean $horz Horizonal Flip 172 * @param boolean $vert Vertical Flip 173 * @return boolean|WP_Error 174 */ 175 abstract public function flip( $horz, $vert ); 176 177 /** 178 * Streams current image to browser. 179 * 180 * @since 3.5.0 181 * @access public 182 * @abstract 183 * 184 * @param string $mime_type 185 * @return boolean|WP_Error 186 */ 187 abstract public function stream( $mime_type = null ); 96 188 97 189 /** … … 111 203 112 204 /** 113 * Checks to see if editor supports mime-type specified205 * Checks to see if editor supports the mime-type specified. 114 206 * Must be overridden in a sub-class. 115 207 * … … 126 218 127 219 /** 128 * Gets dimensions of image 220 * Gets dimensions of image. 129 221 * 130 222 * @since 3.5.0 … … 138 230 139 231 /** 140 * Sets current image size 232 * Sets current image size. 141 233 * 142 234 * @since 3.5.0
Note: See TracChangeset
for help on using the changeset viewer.