WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
Photon Not Resizing Featured Image/Post Thumbnail (33 posts)

  1. Adam Capriola
    Member
    Posted 1 year ago #

    Photon isn't resizing my featured images.

    Before:

    http://i.imgur.com/xHjv1.png

    Image HTML:

    <img width="125" height="125" src="http://www.sixprizes.com/wp-content/uploads/2012/11/season3_ep6_ss3-pikachus-e1352426241464-125x125.jpg" class="attachment-125x125 wp-post-image" alt="season3_ep6_ss3 pikachus" title="Mastering Marathons">

    After:

    http://i.imgur.com/V6nyC.png

    Image HTML:

    <img src="http://i2.wp.com/www.sixprizes.com/wp-content/uploads/2012/11/season3_ep6_ss3-pikachus.jpg?fit=%2C" class="attachment-125x125 wp-post-image" alt="season3_ep6_ss3 pikachus" title="Mastering Marathons">

    Thumbnail generated with this:

    global $post;
    $size = array(125,125); // $size = array(100,100); in sidebars
    $attr = array( 'title' => get_the_title( $post->ID ) );
    get_the_post_thumbnail( $post->ID, $size, $attr );

    Any ideas why it's not working? Photon seems incredible and I'd really like to use it!

    http://wordpress.org/extend/plugins/jetpack/

  2. kevin_k-s
    Member
    Posted 1 year ago #

    There seems to be a general issue with image resizing in photon, not limited to featured images.

  3. Adam Capriola
    Member
    Posted 1 year ago #

    I think my particular issue is due to using $size = array(125,125) for the thumbnail size AND possibly the cropping, rather than a pre-defined size that has a name. I haven't had issues other than the featured images/thumbnails where this is the case.

    I'll try to play around with the code eventually if this isn't fixed in an update.

  4. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    Just to make sure, are you sure Photon is enabled? I checked your http://www.sixprizes.com/2012/11/08/mastering-marathons/ post just now and it seems like Photon might be turned off.

  5. Adam Capriola
    Member
    Posted 1 year ago #

    Yeah it's off right now. I don't want to have the thumbnails messed up on the home page when the site is live.

  6. bheadrick
    Member
    Posted 1 year ago #

    I'm seeing the same issue - I don't understand why there's an issue at all. Instead of hosting the already resized image, photon is hosting the full-sized image and trying/failing to resize it.

    I thought photon would be an easy to setup CDN service - it looks like it even hosts the css and js files - but if it does such an awful job with resized images, which is like 80% of the images on any given site, it's useless.

  7. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    Thanks for the update. I've found out some additional info.

    I think my particular issue is due to using $size = array(125,125) for the thumbnail size AND possibly the cropping,

    Those are two separate issues. The first one that sets a custom thumbnail size has been fixed and you will see the update working in Jetpack 2.0.1 when it is released.

    The cropping problem is more complex and the developers are aware of the issue and working to fix it. It may or may not be updated in 2.0.1.

  8. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    @bheadrick, the problem wasn't for all resized images like you suggested, it was only happening for customized sizes of post thumbnails or when modifications were made to an image but those modifications weren't applied to all sizes. As mentioned above, one of the issues is already fixed and the other is being worked on.

  9. Adam Capriola
    Member
    Posted 1 year ago #

    Thank you for the info Sheri!

  10. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    Here is the fix for the thumbnail resizing issue if you'd like to apply the fix yourself before 2.0.1 is released: http://plugins.trac.wordpress.org/changeset/625457

  11. Adam Capriola
    Member
    Posted 1 year ago #

    I wanted to follow up since 2.0.2 was released. I still have issues with cropped images and I want to bring this up since it looks like the cropping bug might have been worked on.

    How it should look: http://i.imgur.com/OQ6GF.png
    How it looks with Photon on: http://i.imgur.com/vc8hH.png

    It's almost there! Here's what the issue is...

    Post thumbnails where I crop ALL image sizes are appearing correctly (which coincidentally is the case for the first article in the middle). Normally I don't do this, so it's kind of odd that happened to be a case here. But we can work with this info!

    However when I crop just the THUMBNAIL size, what it's loading is a scaled version of the uncropped image. So the scaling is working perfectly now, it's just not applying the crop quite right.

    For reference here's what my HTML looks like:

    Correct thumbnail (where I cropped all image sizes)

    Photon on:

    <img src="http://i1.wp.com/www.sixprizes.com/wp-content/uploads/2012/11/800px-Dawn_Piplup-e1353520156848.png?fit=125%2C125" class="attachment-125x125 wp-post-image" alt="800px-Dawn_Piplup" title="The Marvelous Misadventures of Empoleon / Accelgor at Santiago Regionals">

    Photon off:

    <img width="125" height="125" src="http://www.sixprizes.com/wp-content/uploads/2012/11/800px-Dawn_Piplup-e1353520156848-125x125.png" class="attachment-125x125 wp-post-image" alt="800px-Dawn_Piplup" title="The Marvelous Misadventures of Empoleon / Accelgor at Santiago Regionals">

    Incorrect thumbnail (where I cropped only the thumbnail size)

    Photon on:

    <img src="http://i2.wp.com/www.sixprizes.com/wp-content/uploads/2012/11/star-wars-empire-strikes-back.jpg?fit=125%2C125" class="attachment-125x125 wp-post-image" alt="star wars empire strikes back" title="The Empire Strikes Back! A Norwegian Regionals Report">

    Photon off:

    <img width="125" height="125" src="http://www.sixprizes.com/wp-content/uploads/2012/11/star-wars-empire-strikes-back-e1353514976709-125x125.jpg" class="attachment-125x125 wp-post-image" alt="star wars empire strikes back" title="The Empire Strikes Back! A Norwegian Regionals Report">

    And the post thumbnails are still being generated with this:

    global $post;
    $size = array(125,125); // $size = array(100,100); in sidebars
    $attr = array( 'title' => get_the_title( $post->ID ) );
    get_the_post_thumbnail( $post->ID, $size, $attr );

    I'm going to revert this back to "not resolved" if that's ok, just so everyone knows there's still a bug. Thank you for your efforts with Photon, it's shaping up to be a really great feature!

  12. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    It's the "where I cropped only the thumbnail size" versus the "where I cropped all image sizes" that's the tricky part. This issue will be looked at again in the next major Jetpack release. Thanks tons for the follow-up and specific examples.

  13. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    Adam, can you try these updates and let me know if they solve the problem for you?
    http://plugins.trac.wordpress.org/changeset/632022
    http://plugins.trac.wordpress.org/changeset/632030

  14. Adam Capriola
    Member
    Posted 1 year ago #

    I'm not seeing any difference, unfortunately (for both updates). I'm still getting the same scenario as above where the thumbnail-only crop isn't working.

    I really appreciate you working on this. If you want, I could leave it active on my site so you could see. I'm going to disable it again for now though.

  15. mhk1058
    Member
    Posted 1 year ago #

    I have an issue that if I use Photon, all my images fill the width of the post, regardless of which size I choose to insert in the post. I can resolve this by manually adding image size attributes but this is a bit of a faff - can't WordPress do this automatically - or can JetPack/Photon not see which size image I want to use?

  16. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    @mhk1058, can you link us to an example of one of the posts where this happens? Also, can you talk a little bit about your process for adding images? Do you add them through the WordPress visual editor directly? Which size option do you select when you add an image? Last question for now, does your theme set a $content_width in its functions.php file?

  17. mhk1058
    Member
    Posted 1 year ago #

    Here is a link http://swanseawheelers.co.uk/social/
    The image was added through wordpress HTML editor using size 300 x 199 and the image appeared at that size until Photon is enabled. Then the image reverts to full width unless height & width attributes are aded manually.

    Yes, theme sets $content_width of 980

    Thanks

  18. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    Thanks. I looked at http://swanseawheelers.co.uk/social/ and I see this HTML for the first image in the post while Photon is on:

    <img src="http://i0.wp.com/swanseawheelers.co.uk/wp-content/uploads/2012/10/wheelerssoc.jpg?resize=-300%2C0" alt="" title="Wheelers Social" class="alignleft size-medium wp-image-597">

    That resize value doesn't look right.

    Could you please open the post for editing in your blog's dashboard, copy the img HTML for that same image, and paste it in a reply here?

  19. mhk1058
    Member
    Posted 1 year ago #

    This is straight out of the post:

    [ Code edited with backticks. Moderator note: when sharing code examples, please wrap the code in backticks or use the code button. ]

    <a href="http://swanseawheelers.co.uk/wp-content/uploads/2012/10/wheelerssoc.jpg"><img src="http://swanseawheelers.co.uk/wp-content/uploads/2012/10/wheelerssoc-300x199.jpg" alt="Wheelers Social" title="Wheelers Social" class="alignright size-medium wp-image-668" /></a>

  20. Kelvin Castelino
    Member
    Posted 1 year ago #

    My query here is my does it resize thumbnail images that they get distorted.
    You could check this link http://cfci.org.in/category/cfci_difference/ and similarly all category links, the images are really coming bad!

  21. Kelvin Castelino
    Member
    Posted 1 year ago #

    Can we have a solution like add noresize class or something in some places where I dont want to resize, and definitely how does small image resize into larger one's?
    Wanted to fix this issue soon,coz we going live by next week so!

  22. Adam Capriola
    Member
    Posted 1 year ago #

    @designsimply: I just updated to 2.0.4 but still have the cropping issue. It's the same scenario as I described here.

    Is there any other information I could provide that would help?

    @Everyone else: You might have better luck getting help if you start your own topics. Not to mini-mod, but I'd like to keep my topic on track until the bug is resolved.

  23. Kelvin Castelino
    Member
    Posted 1 year ago #

    I have moved my query too here
    Sorry Adam for causing inconvenience to you :)

  24. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    @mhk1058's issue looks fixed (using Jetpack 2.0.4) at http://swanseawheelers.co.uk/social/ I noted seeing ?resize=-300%2C0 for the image before and now I see ?fit=300%2C300 now. I also see width and height attributes.

    <img src="http://i0.wp.com/swanseawheelers.co.uk/wp-content/uploads/2012/10/wheelerssoc.jpg?fit=300%2C300" alt="" title="Wheelers Social" class="alignleft size-medium wp-image-597" width="300" height="199">

    Screenshot: http://cl.ly/LhKa

    Aside: I wish we had a before screenshot for that one.

  25. designsimply
    Member
    Plugin Contributor

    Posted 1 year ago #

    Adam, I'm starting to think that Photon might be working as expected in your case. But let's go over the details one more time.

    I'm looking at this post:
    http://www.sixprizes.com/2012/11/21/the-marvelous-misadventures-of-empoleon-accelgor-at-santiago-regionals/

    For the 2nd image, I see this HTML:
    <img class="alignright size-medium wp-image-38047" src="http://www.sixprizes.com/wp-content/uploads/2012/11/800px-Dawn_Piplup-e1353520156848-225x225.png" alt="" width="225" height="225">

    Screenshot: http://cl.ly/LhUq

    Could you copy the Photon-version of that img tag one more time with Jetpack 2.0.4 enabled so we can compare it to the example you posted previously? Also, would it be possible for you to get the same example HTML snippets for an image in a new post created after you updated to Jetpack 2.0.4 to rule out a caching issue for your past examples?

  26. mhk1058
    Member
    Posted 1 year ago #

    Yes, thanks, all working fine now with 2.0.4

    Thank you very much

  27. Adam Capriola
    Member
    Posted 1 year ago #

    @designsimply: My issue is with post thumbnails, not in-post images. Images within post content are all fine. But here's the HTML for that image with Photon on:

    <img class="alignright size-medium wp-image-38047" src="http://i2.wp.com/www.sixprizes.com/wp-content/uploads/2012/11/800px-Dawn_Piplup-e1353520156848-225x225.png?resize=225%2C225" alt="" data-recalc-dims="1">

    Screenshot: http://i.imgur.com/3w6Cx.png

    What I'm going to do is save the HTML of the homepage with and without Photon activated. Maybe that will help.

    Files: http://adamcap.com/wp-content/uploads/2012/12/photon-testing.zip

    Again, the thumbnails are generated in my templates with this:

    global $post;
    $size = array(125,125); // $size = array(100,100); in sidebars
    $attr = array( 'title' => get_the_title( $post->ID ) );
    get_the_post_thumbnail( $post->ID, $size, $attr );

    And only the Thumbnail images sizes are cropped. Other sizes are left alone. (I select crop Thumbnail when cropping.) If I do crop All Sizes though, the crop does show correctly on the home page.

  28. Kelvin Castelino
    Member
    Posted 1 year ago #

    @DesignSimply Could you also look into this issue here: http://wordpress.org/support/topic/photon-enlarging-thumbnail-images?replies=1
    Sorry @Adam, but my issue has not got any response from 3 days :(

  29. bloggista
    Member
    Posted 1 year ago #

    Newbie here, but I got same problem with photon on certain images, and I found that those with images with filename like image123-250x200.jpg won't get displayed.

    Deleting these images and re-uploading to content won't work. Try re-naming these images ex. image123.jpg, re-upload to post and it worked. Oh well...

  30. Marcio Marim
    Member
    Posted 11 months ago #

    I am having a problem with Photon and image resizing.
    Photon is not serving the resized images based on my <img> widht and heigh.

    These are some details about how it is working:
    If I use $content_width = 600 in my "functions.php" the images are served resized at 600px (ok). If I remove $content_width the images are served at the original image size (which is 900px for me).
    But the problem I would like that Photon serve the image resized based on <img> width and height if they exist, but it is not happening.

    Do you know if that is a bug or if I need to do something to get that working? Thank you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.