WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#32433 new defect (bug)

Add registered image sizes in WXR export file

Reported by: joehoyle Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Export Keywords: needs-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.

Change History (1)

#1 @swissspidy
3 years ago

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