diff options
| author | Sam Wilkins <samwilkins333@gmail.com> | 2020-02-22 15:42:03 -0500 |
|---|---|---|
| committer | Sam Wilkins <samwilkins333@gmail.com> | 2020-02-22 15:42:03 -0500 |
| commit | 4d1682365eaafb2aea55e6504b124238360c2484 (patch) | |
| tree | f6d6905c8c22422348fab8747e0da1ee4a9843b5 /src/client/views/collections/CollectionSubView.tsx | |
| parent | be19bae1c56d3fd6e510b1aa83231cce8e3f94cc (diff) | |
| parent | dfa1f71ad8c2d69274c67fe16c0dd6ceb53ec75a (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSubView.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index 27a1c6367..6ad187e5c 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -334,8 +334,8 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) { const proto = Doc.GetProto(doc); proto.fileUpload = basename(pathname).replace("upload_", "").replace(/\.[a-z0-9]*$/, ""); if (Upload.isImageInformation(result)) { - proto["data-nativeWidth"] = result.nativeWidth; - proto["data-nativeHeight"] = result.nativeHeight; + proto["data-nativeWidth"] = (result.nativeWidth > result.nativeHeight) ? 400 * result.nativeWidth / result.nativeHeight : 400; + proto["data-nativeHeight"] = (result.nativeWidth > result.nativeHeight) ? 400 : 400 / (result.nativeWidth / result.nativeHeight); proto.contentSize = result.contentSize; } generatedDocuments.push(doc); |
