WordPress.org

Ready to get started?Download WordPress

Forums

WP Retina 2x
[resolved] Plugin Creating Out of Proportion @2x Images (8 posts)

  1. jlomaga
    Member
    Posted 2 years ago #

    Here is an interesting thing I just noticed with the plugin, it's a little wordy hopefully I don't lose you......

    My theme for the Featured Image in a post and the main page slide show uses an image 640x250. WordPress on upload creates this sized image. Most times I'm creating an image in photoshop that is 1280x500, so the proportions stay the same and wordpress doesn't have to crop anything only scale. SO now I have an original image that is 1024x576, wordpress crops the image to 640x250, but Retina 2X creates a @2x version that is 1024x500. THis leads to the image being out of proportion and then when the 2X image loads it cause the image to change size vertically. It seem the plugin when building images isn't taking height into account and is only taking width, as from my original it had the width to generate an image the correct size but not the height.

    So to sum up, is it possible to have the plugin not generate images if there isn't the correct height as well? I'd rather have a low res version load then have an image pop and cause a content shift. I can hard code the image css to be strict on the size however that leads to a squashed image.

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

  2. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    Actually the plugin is supposed to create images that are exactly like the original (or the "resized" original like for example the Thumbnail, Medium and Large) but multiplied by 2.

    Is this "size" of 640x250 showed in the WordPress Media settings? Or is this handled by the theme?

    Is there a way I can reproduce this problem on a basic installation of WordPress with the default theme?

  3. jlomaga
    Member
    Posted 2 years ago #

    It's being handled by my theme. But WP Retina recognizes it fine.

    However I did test using Twenty Eleven and in media setting of wordpress set the thumbnail to 640x250 and select "crop" in media settings(As this acts the same way my theme handles the images). What happens is WP takes the 1024x576 image, it then crops and makes a 640x250, but then the plugin makes a 1024x500 as the @2x version. When you insert the image into the post and then view it, you will see the 640x250 will load and then when the @2x version loads the width remains the same by the height will pop taller and the image will be scaled and not cropped.

  4. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    Hello again,

    Thanks to your details I found the bug for this issue! I updated the trunk of WP Retina 2x, as I want to make sure it works better before to update it for everyone.

    Can you replace two of the plugin files in your WordPress? The two files that needs to be updated are those:
    http://plugins.svn.wordpress.org/wp-retina-2x/trunk/wr2x_vt_resize.php
    http://plugins.svn.wordpress.org/wp-retina-2x/trunk/wp-retina-2x.php

    Then I think you'll have to delete the Retina files that were previously created and... try again. Tell me if it works for you.

  5. jlomaga
    Member
    Posted 2 years ago #

    BINGO, those new files worked perfectly. It didn't create a @2x version for any images that didn't have the required height.

  6. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks, that's awesome :) I'm glad this bug was resolved. I will push the official update sometimes today.

    Please rate the plugin when you have time ^^ And thanks a lot again for finding this bug and testing the new files.

  7. jlomaga
    Member
    Posted 2 years ago #

    Now if only I can figure out how to get the non-wp media to work

  8. Jordy Meow
    Member
    Plugin Author

    Posted 2 years ago #

    You mean the images related to your themes or the other plugins? You will have to upload a @2x images by yourself for those.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.