WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] blogger import image alignment (16 posts)

  1. garyploski
    Member
    Posted 8 years ago #

    I recently tested the Blogger import feature which is very impressive by the way. Happily this was a test. I have 588 blogs and approximately 35% have images. Typically I use the following code - align="right" - so the image is on the right. After testing the Blogger import I see that every image has no align code in the html.

    Was this done on purpose? Has anyone mentioned this yet? I have searched through the support forums and found image discussion but nothing align related. Suggestions? Thoughts? Plans?

    As I mentioned I tested the import process. I am not 'stuck' with a whole bunch of bad code. My Blogger account is still live and I have a backup of every post as of 3/6 so I'm not worried etc. Thanks in advance.

    edit:
    I checked on the blogger code and found that the align code is not what I used in many of my previous hand coded pages.

    Example Blogger image (found in my latest post):
    <img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7492/1085/200/66-days.jpg" border="0" alt="" />

    I can verify that posts with the align=right code are working properly. Happily, and not, only Blogger posts with images were affected by the import.

  2. Poco
    Member
    Posted 8 years ago #

    Do you have a link to your imported blog to take a look at? It is hard to see what might be wrong with it without seeing some of the bad posts.

    Oh, and, if you want to move those blogger hosted images to your wordpress site, I have a plugin that will do just that. It has been used successfully so it can't be all bad. Leave a comment if you use it or you hate it.

    http://notions.okuda.ca/wordpress-plugins/blogger-image-import/

  3. garyploski
    Member
    Posted 8 years ago #

    D'oh. Sorry about that. Here's the test site: http://flipmeover.com and it might help to see the original... http://garyploski.blogspot.com

  4. garyploski
    Member
    Posted 8 years ago #

    On another note: I tried uploading the php file to the plugin folder but WP doesn't see it in the Plugins page. = \

  5. Poco
    Member
    Posted 8 years ago #

    I see, so it didn't remove the align tag, it removed the style tag. I wonder if that is on purpose (seems strange though). I assume you inserted that style tag yourself in the post code? It didn't get added by blogger did it as part of some template did it? Maybe someone with more knowledge of the blogger importer can chime in with some help here.

    As for the plugin, it should just show up in the plugins page to "enable" when you put it in the right place. Have you successfully added any other plugins? Make sure you just download the text - I didn't make it clear how to do that in the tutorial - you can get the latest from here http://dev.wp-plugins.org/file/blogger-image-import/tags/0.2/blogger-image-import.php?rev=5504&format=raw

  6. garyploski
    Member
    Posted 8 years ago #

    I didn't do anything but upload images to Blogger via the Blogger interface.

    Regarding the code I did insert; everything seems to be okay. Odd. I think it has something to do with the Blogger importer.

    I'll try the plugin again in a bit. Thanks.

  7. garyploski
    Member
    Posted 8 years ago #

    After saving the file you linked for the image importer I see the plug-in. Strange though. I saved the php file and uploaded it to the same place. Honestly don't know what the difference was. I should have changed the version I uploade to .bk so I could compare the two files. Alas. That's working fine. I have a few posts to check out after running the test.

    Any thoughts from the developers of the Blogger importer on the image align issue?

  8. kickass
    Member
    Posted 8 years ago #

    I'm going to make a suggestion here- first, using align="right" is old and deprecated code. Secondly, using inline styles is a bad, bad idea. The way to deal with this is in your stylesheet. You can try this in your stylesheet down at the bottom:

    p img {
    float: right;
    }

    It's possible you might need to get more specific with something like this:

    .post-top p img

    or

    .post-bottom p img

    Now, in the html simply make sure your image tag is INSIDE the p tag and make sure you assign a width to your image inside the image tag.

  9. garyploski
    Member
    Posted 8 years ago #

    Thanks for the reply. Yes, align=right, is old code fortunately it seems to have saved a whole lot of work for me and or anyone coding the importer.

    Your suggestion is great is all my images were aligned to the right. Not all were. I mentioned right because it is how I align the majority of my images.

    The inline style is inserted by Blogger, not me or anyone else using Blogger. Therefore, anyone importing their blog from Blogger to WP with the importer will experience this. Any and all alignment coded by Blogger will be lost in the import.

    Thanks for the suggestion but it doesn't actually resolve the issue at hand.

  10. Poco
    Member
    Posted 8 years ago #

    Ah, so you didn't add that inline style yourself? So if you look at your post in the blogger post editor does that style appear or does it get added when you publish? How do you specify that the images should be right aligned?

    I use Picasa/Hello for uploading photos to Blogger and it just inserts an "a href" around an "img" tag. Blogger doesn't add anything. But then again, I don't have anything right aligned.

    Regardless of how you should write your post, it seems strange that the text is modified by the importer. Perhaps it has something to do with the template so the default template inserts the style while the importer template does not. Sorry I can't help more.

  11. Poco
    Member
    Posted 8 years ago #


  12. garyploski
    Member
    Posted 8 years ago #

    Sorry if I wasn't clear in my initial post (or two). The images I uploaded into Blogger are nearly always aligned right. I do this by using the Blogger image upload interface. I nearly always select right align and small thumbnails (vs medium or large).

    The code posted for the image above and below is a sample from a post of an image added to a blog using the method I just described.

    --
    <img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7492/1085/200/66-days.jpg" border="0" alt="" />
    --

    If you/anyone would like to see what the code in Blogger looks at for alignment try uploading a sample image 3 time aligning it left, center, and right. You will see the difference in the code.

    If I can ellaborate any further due to my failed attempt(s) please feel free to contact me here or via email -- wp at garyploski dot com. Thanks to all for your help so far. I'm keeping my fingers crossed that there is a fix/code change that will correct this import problem.

  13. garyploski
    Member
    Posted 8 years ago #

    I feel odd asking this but... Why doesn't this issue show up when I click 'unresolved'?

    It does show up if I click on one of the tags but I wouldn't expect an admin or a developer to look at tags to see what issues are 'unresolved'.

  14. garyploski
    Member
    Posted 8 years ago #

    Since it's been close to a week I thought I'd check in to see if there was anything new. Nope. I advised Andy Skelton (the writer of the new importer) about the trouble. Maybe/hopefully he's working on a fix/advised the new project head about the trouble.

  15. garyploski
    Member
    Posted 7 years ago #

    With the use of SubEthaEdit/TextEdit I took my database. Searched for:

    .jpg" border="0" alt="" />

    Replaced all instances found with:

    .jpg" border="0" align="right" alt="" />

    Dropped the active database.

    FTP'd the newly saved database (with align="right").

    From shell I ran:

    mysql -uusername databasename -p < newlysaveddb.sql

    Refreshed the page and voila! All the images are aligned right.

    It may not be the "cleanest" code but now nearly everything is where I want it.

    If anyone has any suggestions on how this might be easier I'm sure others would appreciate the input.

    This did not fix my posts exactly as I wanted because I had a number of images aligned left. I'm sure I'll go back and tweak those later in a bit.

  16. garyploski
    Member
    Posted 7 years ago #

    Per kickass's suggestion I've attempted the css world (fighting the old school teachings - aka old dog new trick syndrome). Thanks kickass. This stubburn mind needed the kick.

Topic Closed

This topic has been closed to new replies.

About this Topic