Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#16984 closed defect (bug) (fixed)

WP Importer doesn't properly remap resized images

Reported by: duck_'s profile duck_ Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Import Keywords: has-patch
Focuses: Cc:


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:

"" => ""


"" => ""

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 support forum.

Attachments (1)

16984.diff (1.9 KB) - added by duck_ 13 years ago.

Download all attachments as: .zip

Change History (3)

13 years ago

#1 @duck_
13 years ago

Committed so the reporter on the forum can test as well.

#2 @duck_
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Closing this one as fixed now.

Note: See TracTickets for help on using tickets.