Wp-calypso: Reader: Gallery cards not using images in galleries

Created on 1 Mar 2017  路  8Comments  路  Source: Automattic/wp-calypso

Steps to reproduce

  1. Starting at URL: https://wordpress.com/post
  2. Create a post with a mix of single images and image galleries

To trigger the gallery card in the Reader 4 posts bigger than 350px is required. I was able to reproduce this issue in a post that did have 4 single images of sufficient size, but I also included other images in a gallery so at least one of the first 4 images in the post would be inside the gallery.

  1. Publish the post
  2. View the post in the Reader

What I expected

For the Reader to display the post using the gallery card

What happened instead

The Reader displayed the post using the post card, i.e. just the first image along with a text excerpt.

Screenshot / Video

following_ _reader_ _wordpress_com

Additional notes

The size of the gallery thumbnails appears to matter - if I used a two-column layout meaning bigger thumbnails, the Reader used the gallery card, but a three-column layout with smaller thumbnails used the post card. The images in the gallery were all uploaded at a size bigger than 350px.

Context / Source


Reported via the public forums in 836339-f

Reader [Size] L [Type] Bug

Most helpful comment

This is gonna be ... interesting.

The src for each of the gallery images has a photon-style resize applied, so the images really are below our threshold for being included in a gallery card. At least from a display standpoint. The img tags do have data-orig-file and data-orig-size which we could parse and pick up...

All 8 comments

Hrm. My guess is that we're preferring the width and height attributes on the thumbs over the data attribute that has the original size.

Code to mod would be in https://github.com/Automattic/wp-calypso/blob/master/client/lib/post-normalizer/utils.js#L186

Great catch, @KokkieH! Posts with galleries should probably use the gallery card format. ;-)

This is gonna be ... interesting.

The src for each of the gallery images has a photon-style resize applied, so the images really are below our threshold for being included in a gallery card. At least from a display standpoint. The img tags do have data-orig-file and data-orig-size which we could parse and pick up...

sample html:

<img data-attachment-id="225" 
  data-orig-file="https://b19ytest.files.wordpress.com/2017/03/2014-06-09-18-20-38.jpg" 
  data-orig-size="2448,2448" 
  data-comments-opened="1" 
  data-image-meta="{&quot;aperture&quot;:&quot;2.2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;iPhone 5s&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1402338038&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.12&quot;,&quot;iso&quot;:&quot;64&quot;,&quot;shutter_speed&quot;:&quot;0.033333333333333&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" 
  data-image-title="2014-06-09-18-20-38" 
  data-image-description="" 
  data-medium-file="https://b19ytest.files.wordpress.com/2017/03/2014-06-09-18-20-38.jpg?w=300" 
  data-large-file="https://b19ytest.files.wordpress.com/2017/03/2014-06-09-18-20-38.jpg?w=1024" 
  src="https://b19ytest.files.wordpress.com/2017/03/2014-06-09-18-20-38.jpg?w=236&amp;h=236&amp;crop=1" 
  width="236" 
  height="236" 
  data-original-width="236" 
  data-original-height="236" 
  title="2014-06-09-18-20-38" 
  alt="2014-06-09-18-20-38" 
  style="width: 236px; height: 236px;">

Any progress on this? We have another case in the forums for this site. I suspected tiny images too so he's going to try using a larger gallery size for now.

This issue has been marked as stale because it hasn't been updated in a while. It will be closed in a week.
If you would like it to remain open, can you please you comment below and see what you can do to get things moving with this issue?
Thanks! 馃檹

I'm still able to replicate this, so this is still an issue.

Was this page helpful?
0 / 5 - 0 ratings