Make WordPress Core

Opened 9 years ago

Last modified 6 years ago

#32433 new defect (bug)

Add registered image sizes in WXR export file

Reported by: joehoyle's profile joehoyle Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Export Keywords: has-patch
Focuses: Cc:

Description

When a WordPress site is exported, attachments are also exported (though only the original image url). If a user then imports that into a new WordPress install, images will be generated for all registered image sizes on the new blog.

If however, the exported site was running different image sizes, it will potentially have references to those images in post content (e.g. image-322x422.png); however, 322x422 is not a registered image size on the new site. This will produce 404 images in the new post content.

This was acknowledged (though I don't think addressed) in #16984:

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

The user will typically not have control over image sizes either way (as they have to be registered in code) - also the recipient of a WXR file does not know the image sizes on the exported site.

It therefore seems logical to include image sizes somewhere in the WXR file, so importers (the WordPress importer or otherwise) know what image sizes to generate for all existing attachments.

Attachments (1)

diff.patch (2.1 KB) - added by ljasinskipl 6 years ago.
Patch for exporter. After approve change in importer needed.

Download all attachments as: .zip

Change History (3)

#1 @swissspidy
9 years ago

  • Keywords needs-patch added

@ljasinskipl
6 years ago

Patch for exporter. After approve change in importer needed.

#2 @ljasinskipl
6 years ago

  • Keywords has-patch added; needs-patch removed
Note: See TracTickets for help on using tickets.