Skip to content

Commit 8ecf70d

Browse files
committed
show images with unknown height - fixes issue 475 hopefully
1 parent 4b8d7a6 commit 8ecf70d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/components/views/elements/ImageView.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ module.exports = React.createClass({
105105
res = ", " + style.width + "x" + style.height + "px";
106106
}
107107

108+
var size;
109+
if (this.props.mxEvent.getContent().info && this.props.mxEvent.getContent().info.size) {
110+
size = filesize(this.props.mxEvent.getContent().info.size);
111+
}
112+
108113
return (
109114
<div className="mx_ImageView">
110115
<div className="mx_ImageView_lhs">
@@ -124,7 +129,7 @@ module.exports = React.createClass({
124129
<a className="mx_ImageView_link" href={ this.props.src } target="_blank">
125130
<div className="mx_ImageView_download">
126131
Download this file<br/>
127-
<span className="mx_ImageView_size">({ filesize(this.props.mxEvent.getContent().info.size) }{ res })</span>
132+
<span className="mx_ImageView_size">{ size } { res }</span>
128133
</div>
129134
</a>
130135
<div className="mx_ImageView_button">

0 commit comments

Comments
 (0)