• Resolved WPMonkeyATL

    (@wpmonkeyatl)


    Hello – it seems that WordPress Jetpack causes conflict with Retina 2X, thereby causing images to be displayed too small on retina devices. At least that’s what I’m experiencing.

    Specifically, it seems Jetpack introduces its own handling of retina icons etc within its own UI for the features it includes. This causes the image “width” and “height” attributes specified on any image inserted into a post to be recalculated by Retina 2x to a smaller size than specifically indicated in the post itself.

    To see what might be going on, try this:

    1. Install the WordPress Jetpack (or more easily, install Slim Jetpack) plugin, and activate it. No need to activate any of the modules within Jetpack – just activating the Jetpack plugin causes the issues.

    2. Make sure Retina 2x is activated as well. I’ve experienced this with HTML Re-Write mode (although it seems to occur on retina.js and server side as well).

    3. Create a post with an inserted image of a specific size, for example width=720 height=360. Of course, ensure the original uploaded image is at least 1440×720, so Retina 2x can generate appropriate @2x images.

    4. Access this on an iphone retina, check out the html code delivered to the iphone itself (e.g. using browser developer tools and/or simulation). You will see that the appropriate @2x image file for size 720×360 was delivered.

    5. Now, normally (Retina 2x without Jetpack) you would also see the html img attributes height=”720″ and width=”360″ being delivered to the iphone, the same dimensions you defined in the post. However with Jetpack activated, these get recalculated to something about half the size smaller like width=”268″ and height=”178″ (depending on padding etc) AND A NEW ATTRIBUTE scale=”2″ is included in the html img. Note: this “scale” might be set to scale=”0″ when viewing on an ipad.

    6. This “scaling” attribute does not occur when Jetpack is deactivated. Is this scaling methodology by Jetpack the culprit?

    7. Basically, with Jetpack activated, the height and width of the image get dynamically recalculated and “hard wired” to the physical size for the device, not the size specified in the post definition.

    8. This “hard wiring” of the width and height is a problem because if you then rotate the iphone (or ipad retina), then the image will display in the wrong size (the hard-wired size) for the new orientation (i.e. displays smaller than it should for the wider landscape orientation).

    So basically, the proper @2x image is being delivered, but the hard-wired (and recalculated to smaller sizes) height and width cause issues on retina mobile devices and ipad/tablets that are rotated to see a landscape view. Seem that Jetpack’s “scaling” behavior is causing recalculation and hard-wiring of the image height & width in the html.

    Of course, when Jetpack is deactivated, then Retina 2x continues to behave properly as always.

    Considering that Jetpack offers a lot of interesting functionality (e.g. tiled galleries, carousel, social sharing buttons, etc) I would suspect many people will try to install Jetpack (or Slim Jetpack) alongside Retina 2x, and thus may end up having a similar conflict.

    Might anyone have ideas on this? Might there be a CSS tweak that could prevent this conflict from occurring?

    Hope this makes some sense, thanks in advance.

    http://wordpress.org/plugins/wp-retina-2x/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    It seems like JetPack needs to detect the WP Retina 2x plugin and to avoid rewriting the width and height of the images in that case. It seems it is the only solution. There could be also an option to prevent that to happen in JetPack? I don’t know, I never used it, I am staying far away from such plugins doing too many things 🙂

    The best is to ask them directly.

    Thread Starter WPMonkeyATL

    (@wpmonkeyatl)

    It seems this “scaling” thing that Jetpack does within the HTML is causing Retina 2x to dynamically recalculate image size attributes.

    For example, with Jetpack activated, Retina 2x NOT activated:
    html delivered to iphone has: width=720, height=360, scale=”0″

    Then, with Jetpack activated and Retina 2x ALSO activated:
    html delivered to iphone has: width=”268″, height=”178″, scale=”2″

    Even without Retina 2x the scale=”0″ occurs. This scaling methodology seems to be what is causing the conflict with Retina 2x.

    Anybody have any ideas on how to “turn the scaling off”, is there a CSS tweak that might achieve that?

    Thanks!

    Plugin Author Jordy Meow

    (@tigroumeow)

    With Jetpack enabled, what is the actual size of the image? Download it and check its size.

    To me, it looks like JetPack is modifying the image on its send, and if it’s the retina image it’s not really good.

    There is probably no CSS trick for that.

    Thread Starter WPMonkeyATL

    (@wpmonkeyatl)

    Hello, with Jetpack the image size delivered is the “Large” one, and with Retina 2x enabled it is the @2x version of the Large one (in my case, large is 720×360).

    Hopefully there’s a CSS way to suppress the scaling…

    Thread Starter WPMonkeyATL

    (@wpmonkeyatl)

    Hello Again – I reported this issue on the Jetpack plugin support, and they seem to think this may be a bug in Jetpack itself. The good news: they suggested a fix to prevent Jetpack from serving up the “scale” attribute in image URLs across-the-board.

    The thread (and fix) is here:
    http://wordpress.org/support/topic/jetpack-always-adding-scale-to-image-urls-on-retina-devices/

    I have applied the fix suggested and now Jetpack is working very nicely with Retina 2x. Retina 2x is serving up the retina @2x images with the proper sizing as intended.

    Thanks again for your help.

    Plugin Author Jordy Meow

    (@tigroumeow)

    Great, that’s a good news. I hope it will help others 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Image Sizing Conflict with WordPress Jetpack?’ is closed to new replies.