[wp-trac] [WordPress Trac] #16984: WP Importer doesn't properly remap resized images

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 28 11:26:32 UTC 2011


#16984: WP Importer doesn't properly remap resized images
--------------------------+---------------------------
 Reporter:  duck_         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  WordPress.org
Component:  Import        |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+---------------------------
 When importing attachments the importer will attempt to remap all the URLs
 in posts and postmeta. For images this is more complex since a number of
 different sized images are generated for use.

 Unfortunately the current importer is still only attempting to remap the
 pre-2.5 `image.thumbnail.ext` URLs. The new scheme is `image-WWWxHHH.ext`.

 Mapping thumbnails introduced in [6428] and unchanged since then. For the
 'new' naming scheme for resized images see [7041], [7135].

 Proposed solution is to strip the extension from the unsized URLs and map
 those instead. So change from mapping:

 {{{
 "http://export.site/wp-content/uploads/2005/03/IMG_1398.thumbnail.jpg" =>
 "http://import.site/wp-content/uploads/2005/03/IMG_1398-150x150.jpg"
 }}}

 to:

 {{{
 "http://export.site/wp-content/uploads/2005/03/IMG_1398" =>
 "http://import.site/wp-content/uploads/2005/03/IMG_1398"
 }}}

 This stub mapping for images could allow for ignoring the normal longer
 remap rules (`$this->url_remap[$url] = $upload['url'];`) for images to
 save on some database queries.

 A problem that might arise is if there are different image size settings
 on the export and import sites. So an exported post might contain an image
 img-200x200.jpg but the import site hasn't generated the appropriate size.
 For the first patch I'm ignoring this and saying that it's up to the user
 to ensure the settings are consistent. Potential future fixes include
 importing options or generating the extra sizes on the fly

 Cross-reference thread on [http://wordpress.org/support/topic/plugin-
 wordpress-importer-import-of-posts-does-not-include-images support forum].

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16984>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list