-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix uploading zipped tiff (should set needsConversion=true) #7856
Changes from 2 commits
9eb5bd6
8b8ec9a
2282e77
d5b96b5
b4215f9
724b3c2
7508944
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -290,7 +290,8 @@ class UploadService @Inject()(dataSourceRepository: DataSourceRepository, | |
} yield explored) | ||
.toList) | ||
combinedLayers = exploreLocalLayerService.makeLayerNamesUnique(dataSources.flatMap(_.dataLayers)) | ||
dataSource = GenericDataSource[DataLayer](dataSourceId, combinedLayers, dataSources.head.scale) | ||
firstExploredDatasource <- dataSources.headOption.toFox | ||
dataSource = GenericDataSource[DataLayer](dataSourceId, combinedLayers, firstExploredDatasource.scale) | ||
Comment on lines
+293
to
+294
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the advantage of this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
path <- Fox.runIf(combinedLayers.nonEmpty)( | ||
exploreLocalLayerService.writeLocalDatasourceProperties(dataSource, path)) | ||
} yield path | ||
|
@@ -418,7 +419,8 @@ class UploadService @Inject()(dataSourceRepository: DataSourceRepository, | |
|
||
private def looksLikeN5Multilayer(dataSourceDir: Path): Box[Boolean] = | ||
for { | ||
_ <- containsMatchingFile(List(FILENAME_ATTRIBUTES_JSON), dataSourceDir, 1) // root attributes.json | ||
matchingFileIsPresent <- containsMatchingFile(List(FILENAME_ATTRIBUTES_JSON), dataSourceDir, 1) // root attributes.json | ||
_ <- bool2Box(matchingFileIsPresent) | ||
directories <- PathUtils.listDirectories(dataSourceDir, silent = false) | ||
detectedLayerBoxes = directories.map(looksLikeN5MultiscalesLayer) | ||
_ <- bool2Box(detectedLayerBoxes.forall(_.openOr(false))) | ||
|
@@ -433,7 +435,8 @@ class UploadService @Inject()(dataSourceRepository: DataSourceRepository, | |
// - directories 0 to n | ||
// - attributes.json (N5Header, dimension, compression,...) | ||
for { | ||
_ <- containsMatchingFile(List(FILENAME_ATTRIBUTES_JSON), dataSourceDir, 1) // root attributes.json | ||
matchingFileIsPresent <- containsMatchingFile(List(FILENAME_ATTRIBUTES_JSON), dataSourceDir, 1) // root attributes.json | ||
_ <- bool2Box(matchingFileIsPresent) | ||
datasetDir <- PathUtils.listDirectories(dataSourceDir, silent = false).map(_.headOption) | ||
scaleDirs <- datasetDir.map(PathUtils.listDirectories(_, silent = false)).getOrElse(Full(Seq.empty)) | ||
_ <- bool2Box(scaleDirs.length == 1) // Must be 1, otherwise it is a multiscale dataset | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rephrase entire comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, done :)