WordPress.org

Ready to get started?Download WordPress

Forums

JM Twitter Cards
Image resizing (10 posts)

  1. ctheory11
    Member
    Posted 4 months ago #

    Love the plugin! Thanks for all your hard work.

    I've got it working with summary_large_image on one of my sites. It pulls from my featured post images, which are 1332x740, or smaller with the same ratio. The Card Validator shows that Twitter is pulling in the original images without resizing:

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:image" content="http://passivepromotion.resonancemasteri.netdna-cdn.com/wp-content/uploads/2012/10/mixingboard_1332x740.jpg">
    <meta name="twitter:site" content="@colortheory">
    <meta name="twitter:creator" content="@colortheory">
    <meta name="twitter:description" content=""Garbage in, garbage out" is a common saying among mastering engineers. The quality of the source material limits the quality of the final product. Most of my clients have no problem following my simple preparation …">
    <meta name="twitter:title" content="A Mastering Engineer’s Guide to Final Mixdown">
    <meta name="twitter:url" content="http://passivepromotion.com/a-mastering-engineers-guide-to-final-mixdown">

    I've set up the plugin on a second site, which is pretty much identical. Same theme, same plugins, same settings. The plugin (I guess) saves the image at the thumbnail size I select.

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:image" content="http://colortheory.com/wp-content/uploads/2013/12/rent_1332x740-560x740.jpg">
    <meta name="twitter:site" content="@colortheory">
    <meta name="twitter:creator" content="@colortheory">
    <meta name="twitter:description" content=""Rent" is my all-time favorite Pet Shop Boys song, so when Matt Mancid asked me about covering an 80's song in a current style together, it was the first thing that popped into my head. …">
    <meta name="twitter:title" content="Matt Mancid & Color Theory – Rent ft. Faded Paper Figures">
    <meta name="twitter:url" content="http://colortheory.com/matt-mancid-color-theory-rent-ft-faded-paper-figures">

    I suppose the second is how the plugin is supposed to act, since it's the size I selected (Max mobile retina). Well, actually, it's 10 pixels shorter than what it says in the settings (560x750). I have force crop set to "no" but it doesn't seem to matter. In any case, It really doesn't look good.

    I'd prefer it to just load in my full image like it does on the first site, and show the whole thing. Any ideas how I could do that?

    https://wordpress.org/plugins/jm-twitter-cards/

  2. jmlapam
    Member
    Plugin Author

    Posted 4 months ago #

    Hi,

    That does not work like this. In fact there's no point getting the exact size e.g here 560*750 simply because it's the maximum size that Twitter can handle for mobile retina.

    So basically WordPress just resize and crop but it does save the original ratio like Twitter does. I mean you do not want stretched images that can turn to blur effect.

    Hope it helps. I cannot show you how to disable this unless you have some basic PHP knowledge to apply modification in code. The plugin does not provide opt-out for this because images that are too big break Twitter cards.

  3. ctheory11
    Member
    Posted 4 months ago #

    Thanks for your help!

    I don't understand why the plugin is doing two different things on two identical sites, with feature images that are sized the same (1332x740 typically).

    For example, for Passive Promotion, the images always look perfect, and twitter_image property shows the source file.

    https://twitter.com/colortheory/status/437793577234485248

    But for Color Theory, it crops it and creates new image files on my server, with the resolution appended to the name of the source file:

    https://twitter.com/colortheory/status/438063756879228928

    Is there anything I can do to make the second site perform like the first?

  4. jmlapam
    Member
    Plugin Author

    Posted 4 months ago #

    Ah I see. Are you sure you have the exact same settings? Maybe on one site you have the crop option set to yes and on the other site it's set to no. Check it please.

  5. ctheory11
    Member
    Posted 4 months ago #

    Yep, they are identical. When I put Passive Promotion URL's in the Card Validator, it uses the original images. When I put Color Theory's in, it uses a cropped image with a dash and the resolution appended to the filename.

    Here's a screenshot of the settings for both.

    It's not just the settings for your plugin that are the same. Both sites share the same theme, same plugins, same settings. There are only a couple small differences. That's why I can't figure it out!

  6. jmlapam
    Member
    Plugin Author

    Posted 4 months ago #

    Ah ok it's because Twitter does not change the original ratio of image unless it's really really big. So in this case images do not have the same ratio.

  7. ctheory11
    Member
    Posted 4 months ago #

    The images are usually 1332x740, on both sites. I still can't figure out why two identical sites with the same settings are handled differently.

  8. jmlapam
    Member
    Plugin Author

    Posted 3 months ago #

    I came across this bug : I use a function called wp_get_attachment_image_src for image size that does not support actually custom size but only built-in size such as medium, full, thumbnail, etc.

    This might be related to this !

  9. ctheory11
    Member
    Posted 3 months ago #

    Interesting! Hope that's it.

  10. jmlapam
    Member
    Plugin Author

    Posted 3 months ago #

    Actually this is supposed to retrieve custom sizes so it's not that sorry ! In addition to this you get the resized images here so it's not that.

Reply

You must log in to post.

About this Plugin

About this Topic