about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-06-25 00:12:15 +0200
committerGitHub <noreply@github.com>2018-06-25 00:12:15 +0200
commit45b5e60909a9874bfcf33439ebd277df69631285 (patch)
treea6c5150a79adffc03f970bd8b574e2f4eecec56d
parent50a2854f922ebdd2c056870a0de402329bdf1bb3 (diff)
Fix Chrome issue with sizes="0px" (#7886)
"Do not dumb here. Not dumb area here."
-rw-r--r--app/javascript/mastodon/components/media_gallery.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js
index 7c4444e0e..1d351279f 100644
--- a/app/javascript/mastodon/components/media_gallery.js
+++ b/app/javascript/mastodon/components/media_gallery.js
@@ -122,7 +122,7 @@ class Item extends React.PureComponent {
       const hasSize = typeof originalWidth === 'number' && typeof previewWidth === 'number';
 
       const srcSet = hasSize ? `${originalUrl} ${originalWidth}w, ${previewUrl} ${previewWidth}w` : null;
-      const sizes  = hasSize ? `${displayWidth * (width / 100)}px` : null;
+      const sizes  = hasSize && (displayWidth > 0) ? `${displayWidth * (width / 100)}px` : null;
 
       const focusX = attachment.getIn(['meta', 'focus', 'x']) || 0;
       const focusY = attachment.getIn(['meta', 'focus', 'y']) || 0;