[wp-trac] [WordPress Trac] #34124: image_get_intermediate_size not filterable

WordPress Trac noreply at wordpress.org
Fri Oct 2 11:35:50 UTC 2015


#34124: image_get_intermediate_size not filterable
-------------------------+-----------------------------
 Reporter:  A5hleyRich   |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Media        |    Version:  4.3.1
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The large majority of functions within `wp-includes/media.php` are
 filterable, which allows plugins to modify the return URLs and file paths
 for attachments.

 The problem with `image_get_intermediate_size` is that if all other
 methods of determining the correct image size fails, it falls back to the
 following:

 {{{
 // include the full filesystem path of the intermediate file
 if ( empty($data['path']) && !empty($data['file']) ) {
         $file_url = wp_get_attachment_url($post_id);
         $data['path'] = path_join( dirname($imagedata['file']),
 $data['file'] );
         $data['url'] = path_join( dirname($file_url), $data['file'] );
 }
 return $data;
 }}}

 The `$data['url']` value is directly used in `wp_image_editor` to output a
 preview of the existing image before making any edits:

 [[Image(https://dl.dropboxusercontent.com/u/57382934/Media%20Library%20%E2%80%B9%20Release%20Testing%20%E2%80%94%20WordPress.png)]]

 The reason the image has returned 404 in this cause is because it's being
 served from S3 and contains illegal characters that need encoding.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34124>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list