Skip to content

Commit db7096d

Browse files
committed
Fix spiceserver issues when format is GTiff
1 parent e0f2367 commit db7096d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

isis/src/base/apps/spiceinit/SpiceClient.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ namespace Isis {
7777

7878
raw += " <label>\n";
7979
stringstream str;
80+
// Force BandSequential format as a hack to avoid issues
81+
// opening/operating on GTiff formated data
82+
PvlObject& core = cubeLabel.findObject("IsisCube").findObject("Core");
83+
if (core.findKeyword("Format")[0] == "GTiff") {
84+
core.findKeyword("Format") = "BandSequential";
85+
}
8086
str << cubeLabel;
8187
raw += QString(QByteArray(str.str().c_str()).toHex().constData()) + "\n";
8288

isis/src/base/objs/Cube/Cube.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,9 @@ namespace Isis {
926926
realDataFileLabel(), true);
927927
}
928928
else if (m_format == GTiff) {
929-
m_dataFile->close();
929+
if (m_dataFile) {
930+
m_dataFile->close();
931+
}
930932
m_geodataSet = GDALDataset::FromHandle(GDALOpen(m_dataFileName->expanded().toStdString().c_str(), eAccess));
931933
if (!m_geodataSet) {
932934
QString msg = "Opening GDALDataset from [" + m_dataFileName->name() + "] failed with access [" + eAccess +"]";

0 commit comments

Comments
 (0)