Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing Error: External Images for posts imported from Livejournal to Wordpress #1

Open
peterkirs opened this issue Aug 19, 2012 · 6 comments

Comments

@peterkirs
Copy link

Thanks Chris Olbekson, I have got the reference on your marvelous tool.

http://wordpress.org/support/topic/plugin-add-linked-images-to-gallery-simply-removes-the-src-tag-result-empty-image?replies=2#post-3035230

Media tools works perfect, but there is a bug which is very important for me.
I imported many posts from LiveJournal to Wordpress with Livejournal Import (LJ import version as June 2012),

but your media tool cannot convert images from these imported posts.
E.g the Log:
Will the EUR/CHF never rise over 1.22 again ?
as in http://backup.snbchf.com/2012/03/will-the-eurchf-never-rise-over-1-22-again/

Running import media tool
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Img already in media library
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Img already in media library
Img already in media library
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Img already in media library
Img already in media library
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
Upload Error: Could not upload image. Check for malformed img src url
No external images found for Will the EUR/CHF never rise over 1.22 again ?

or one simple image in
http://backup.snbchf.com/2012/05/the-vicious-cycle-of-the-us-economy-or-why-the-us-dollar-must-ultimately-fall-again/

Log:
Running import media tool
Upload Error: Could not upload image. Check for malformed img src url
No external images found for The vicious cycle of the US economy or why the US dollar must ultimately fall again

Media tool complete (Post ID 23) in 3.108 seconds. 1 errors

Such an un-parsable image is:

@c3mdigital
Copy link
Owner

Hi thanks for taking the time to submit this. Looking at the src attribute the images are missing the file extension.

<p><a href="http://pics.livejournal.com/georgedorgan/pic/0003q44e/"><img style="border-width: 0px; border-style: solid;" src="http://pics.livejournal.com/georgedorgan/pic/0003q44e/s640x480" alt="" width="640" height="143"></a></p>

The plugin uses the WordPress media_sideload_image function which requires a full url including file extension to work. Even though the images work in the browser WordPress will return the WP_Error object when it encounters the file.

@peterkirs
Copy link
Author

Thanks for the quick reply. That explains a lot, why the plugin "add images to gallery" not works, but maybe also why I cannot do Wordpress XML export and import.

http://wordpress.org/support/topic/wordpress-import-creates-masses-of-duplicated-media-not-more?replies=7#post-3040465
The import actually creates lots of duplicated images.

Means anybody who migrated from Livejournal to Wordpress will not be able to use your tool.

@peterkirs
Copy link
Author

HI Chris,
I added the file extension to all images in one post manually. The images got imported source attribute got correctly changed.
Unfortunately the images still link to life journal via HREF

This is an important feature which is missing in your tool: Usually when you import posts (from another blog) then both HREF and SRC point to the old blog and are equal.

This implies that in the case that HREF=SRC then you should replace both SRC and HREF by the imported image.
--> you probably do that already ?

In my case: SRC = HREF.[FileExtension]
--> you do not replace HREF

@c3mdigital
Copy link
Owner

I am considering adding this feature. It would have to be via an opt in option to make sure that is what the user wants.

@c3mdigital
Copy link
Owner

The issue of the missing file extension handling is being worked on for WordPress core. The bug hasn't been accepted yet but thanks to your feedback along with other users I'm going try and get it pushed through. See http://core.trac.wordpress.org/ticket/18730#comment:3 for more info.

The logical way to handle this is read the file headers and add the correct extension based on the mime type instead of relying on the extension.

@peterkirs
Copy link
Author

Thank you,
I got the same issue not only with life journal, but also with imported gravatars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants