Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop images on gallery stopped working in 2.2 #5128

Closed
Axinet opened this issue Feb 18, 2018 · 5 comments
Closed

Crop images on gallery stopped working in 2.2 #5128

Axinet opened this issue Feb 18, 2018 · 5 comments
Labels
[Type] Bug An existing feature does not function as intended

Comments

@Axinet
Copy link

Axinet commented Feb 18, 2018

Issue Overview

Crop images on gallery stopped working in 2.2.2 (horizontal images are lower than vertical ones).

Steps to Reproduce (for bugs)

  1. Insert gallery block
  2. Use one horizontal and one vertical image
  3. Show result on frontend.

Expected Behavior

Images should be cropped like were in Gutenberg 2.1

Current Behavior

Images are not cropped.

Related Issues and/or PRs

Related to gallery captions css changes #1443 .
Problem is with styles for .wp-block-gallery .blocks-gallery-item figure which has now display: flex. Reverting to dispaly: block fixes the problem with cropping (but probably destroys captions placement).

@jeffpaul jeffpaul added the [Type] Bug An existing feature does not function as intended label Mar 8, 2018
@karmatosed
Copy link
Member

I am unable to replicate this, which could mean it's now fixed. It also could mean I am missing a step or it's something related to your setup. In this case, let's close the issue but if you are still able to replicate we absolutely can reopen.

@ptica
Copy link

ptica commented Jan 7, 2019

I still got bitten by this one at 5.0.2,
out of the box looks like:
screenshot 2019-01-07 at 08 06 11

Figure display changed to block fixes it for me:
screenshot 2019-01-07 at 08 06 36

It manifests itself only when the 'Link to' option is set to 'Media file' though!

@dimanotdemo
Copy link

dimanotdemo commented Jan 28, 2019

@karmatosed I am still seeing this issue as of 5.0.3 and 5.1-beta2-44700. This issue is present when the image is linked ("Media File" or "Attachment Page"). Would recommend reopening this.

@StaggerLeee
Copy link

StaggerLeee commented Apr 17, 2019

I experience the same. Linking to None makes it work OK.

@centuryseven
Copy link

This CSS fixed the issue for me:

.wp-block-gallery .blocks-gallery-image figure, .wp-block-gallery .blocks-gallery-item figure {
margin: 0;
height: 100%;
display: flex;
align-items: flex-end;
justify-content: flex-start;
}

.wp-block-gallery.is-cropped .blocks-gallery-image a, .wp-block-gallery.is-cropped .blocks-gallery-image img, .wp-block-gallery.is-cropped .blocks-gallery-item a, .wp-block-gallery.is-cropped .blocks-gallery-item img {
width: 100%;
flex: 1;
-o-object-fit: cover;
object-fit: cover;
height: 100%;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

7 participants