• Resolved odie2

    (@odie2)


    Hello,

    I have own: add_image_size( 'featured-image', 1200, 335, true );

    However, I am migrating from old Joomla and have images with max width 800px.
    My post image in full-width page is exactly 1200x335px. I am using max-height: 335px; for div parent, so it’s nicely responsive.

    Problem is if I’ll upload for example 800x600px 'featured-image' is created in 800x335px with hard crop. My css stretch it to 1200px with width: 100%, but I have additional image areas on top and bottom of image (800px -> 1200px: 1,5 so 335px * 1,5 = 502,5px).

    I can’t force div parent for height: 335px; so I could vertical center image by this, because responsive max-height: 335px;.

    I need to WordPress creates 1200x335px or 800x223px (height – 335px / 1,5), so then css will stretch it right.

    JSFiddle (without JS) – unexpected result two issues: higher in expected in zoom-in and bad placed in zoom-out.

    My all known ways to find solution – used.
    Thanks in advance!
    Greetings

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stretch too short image for image size’ is closed to new replies.