Skip to content

Image Galleries broken since Version 0.78  #3013

@thetoby9944

Description

@thetoby9944

Summary

Using st.beta_columns(n) and filling them with images (use_column_widht=True) will produce differently sized images - even when the images have the same size in the first place

Steps to reproduce

Code snippet:

import streamlit as st
import numpy as np

# Produce 3 images and put them into 3 columns next to each other, scaling them automatically to columns width
[col.image(img, use_column_width=True) for col, img in zip(st.beta_columns(3), np.zeros((3, 250, 250, 3)))]

Expected behavior:

Three equally sized black images

Actual behavior:

image

The first image in a columns layout will always be displayed slightly larger than the other.

Is this a regression?

yes, this used to work perfectly up to version 0.77

Debug info

  • Streamlit version: from 0.78 to 0.79
  • Python version: 3.7
  • pip
  • OS version: Tested on Windows10 and Ubuntu 18.04
  • Browser version: Opera / Chrome /

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working as expectedtype:regressionThis bug is a regression from previous behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions