Skip to content
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

Fixed error when trying to export a compressed image using pds2hideal. Fixes #5525. #2059

Merged
merged 2 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions isis/src/base/objs/ImportPdsTable/ImportPdsTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,18 @@ namespace Isis {
}
// Get some pertinent information from the label
PvlObject &tabObj = label.findObject(tableName);
// The table description contains the actual "RECORD_BYTES"
if (tabObj.hasKeyword("RECORD_BYTES")) {
m_recordBytes = (int) tabObj.findKeyword("RECORD_BYTES");
}
// The table description has "ROW_BYTES" and "ROW_SUFFIX_BYTES". These summed is the
// record length. Can be for detached and attached labels
else if (tabObj.hasKeyword("ROW_BYTES") && tabObj.hasKeyword("ROW_SUFFIX_BYTES")) {
m_recordBytes = (int) tabObj.findKeyword("ROW_BYTES") +
(int) tabObj.findKeyword("ROW_SUFFIX_BYTES");
}
// The table record length is defined by the file record
// length (i.e., table is in with the image)
else {
m_recordBytes = (int) label.findKeyword("RECORD_BYTES");
}
Expand Down
2 changes: 2 additions & 0 deletions isis/src/base/objs/ImportPdsTable/ImportPdsTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ namespace Isis {
* @history 2016-02-24 Ian Humphrey - Updated documentation and unit test. Added edrindex.lbl
* and edrindex.tab files to data directory (for tests). Fixes #2397.
* @history 2016-03-10 Jeannie Backer - Removed non-UTF8 character. References #2397.
* @history 2018-02-12 Stuart Sides - Added detached table capabilities for label files
* without a "RECORD_BYTES" keyword. References #5525.
*
*
* @todo The binary table import methods were written after the ascii table
Expand Down
17 changes: 17 additions & 0 deletions isis/src/mro/apps/pds2hideal/tsts/compressedImage/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This tests the following conditions:
#
# -- We can export a compressed image.
# -- The tables in the compressed image do not have the keyword RECORD_BYTES.
# -- When exported, the compressed and uncompressed input data produce the same output.
APPNAME = pds2hideal

include $(ISISROOT)/make/isismake.tsts

commands:
$(APPNAME) FROM=$(INPUT)/PSP_009492_1280_RED.NOPROJ.lbl \
to=$(OUTPUT)/uncompressed_lbl.cub > /dev/null;
$(APPNAME) FROM=$(INPUT)/PSP_009492_1280_RED_COMPRESSED.NOPROJ.IMG \
to=$(OUTPUT)/compressed_img.cub > /dev/null;
cubediff from=$(OUTPUT)/uncompressed_lbl.cub from2=$(OUTPUT)/compressed_img.cub \
to=$(OUTPUT)/comparisonTruth.txt > /dev/null;