Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#31581 new defect (bug)

Images-Links broken after import from wordpress.xml in WordPress 4.1.1

Reported by: wulfp's profile WulfP Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: Import Keywords:
Focuses: administration Cc:

Description

In XML:
<wp:meta_value><..."Fotolia_65968659_S-300x205.jpg"...></wp:meta_value>

After Import the Image-File is created as

Fotolia_65968659_S-300x206.jpg

but the img-src still is ...300x205.jpg.

The same happend to Fotolia_66268596_S-300x199.jpg. The Filename was changed to ...300x200.jpg, the link did´n change.

Seems to be a rounding-issue when recalculating Image-Sizes.

Change History (3)

#1 @kraftner
9 years ago

I can confirm this issue. The problem was introduced in [30660] as a result of #18532 changing the rounding behaviour when scaling images.

Generally this doesn't cause any issues on existing sites because existing files and <img> aren't touched.

But when you are regenerating thumbs or importing attachments from a WXR file they get generated differently in the filesystem leaving all <img> in post_content dead.

I also have a question on WPSE looking for a solution or workaround: http://wordpress.stackexchange.com/q/202622/47733

I am not sure yet if this should be handled in core or the importer (or any other plugins that have an issue with this like image regeneration plugins)

This ticket was mentioned in Slack in #core by kraftner. View the logs.


9 years ago

#3 @kraftner
9 years ago

I have mentioned this workaround in the WPSE question linked above, but adding it here anyway:

[30660] introduced a new filter wp_constrain_dimensions which can be used to just plug the old behaviour from before 4.1 back in, but this isn't really a solution, just a revert to old behaviour.

Note: See TracTickets for help on using tickets.