Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

update file size limits

Mike McGann8d64290ef98a
diff --git a/web/js/image/panel.js b/web/js/image/panel.js
index d4dc76fbc..174c8518b 100644
--- a/web/js/image/panel.js
+++ b/web/js/image/panel.js
@@ -15,6 +15,8 @@ import {
imageUtilGetConversionFactor
} from './util';
+const maxSize = 8200;
+
const resolutionsGeo = {
values: [
{ value: '0.125', text: '30m' },
@@ -96,7 +98,8 @@ export function imagePanel(models, ui, config, dialogConfig) {
fileType: imgFormat,
valid: true,
resolutions: resolutions,
- fileTypes: fileTypes
+ fileTypes: fileTypes,
+ maxImageSize: `${maxSize}px x ${maxSize}px`
};
self.reactComponent = ReactDOM.render(
@@ -138,7 +141,7 @@ export function imagePanel(models, ui, config, dialogConfig) {
resolution: imgRes.toString(),
proj: models.proj.selected.id,
worldfile: imgWorldfile,
- valid: fileSizeValid(),
+ valid: imageSizeValid(),
fileSize: imgFilesize,
imgHeight: imgHeight,
imgWidth: imgWidth,
@@ -300,8 +303,14 @@ export function imagePanel(models, ui, config, dialogConfig) {
return ((imgWidth * imgHeight * 24) / 8388608).toFixed(2);
};
- let fileSizeValid = function() {
- return imgFilesize < 250 && imgHeight !== 0 && imgWidth !== 0;
+ const imageSizeValid = function() {
+ if (imgHeight === 0 && imgWidth === 0) {
+ return false;
+ }
+ if (imgHeight > maxSize || imgWidth > maxSize) {
+ return false;
+ }
+ return true;
};
let setPosition = function() {