Commit 563da45e authored by Kristin Berry's avatar Kristin Berry
Browse files

Updated ProcessExportPds4 to interpet filename.xml as a label output name not an image output name

parent 68b6bd41
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ namespace Isis {
   * This method write out the labels and image data to the specified output file.
   * Creates an IMG and XML file. 
   *  
   * @param outFile QString of the name of the output file. Will create an XML 
   * @param outFile QString of the name of the output image file. Will create an XML 
   *        and an IMG file with the output file name.
   *
   */
@@ -477,10 +477,20 @@ namespace Isis {
    
    FileName outputFile(outFile);

    // Name for output label
    QString path(outputFile.originalPath());
    QString name(outputFile.baseName());
    QString labelName = path + "/" + name + ".xml";

    // Name for output image
    QString imageName = outputFile.expanded();

    // If input file ends in .xml, the user entered a label name for the output file, not an
    // image name with a unique file extension. 
    if (QString::compare(outputFile.extension(), "xml", Qt::CaseInsensitive) == 0) {
      imageName = path + "/" + name + ".img";
    }

    QDomElement rootElement = m_domDoc->documentElement();
    QDomElement fileAreaObservationalElement =
                    rootElement.firstChildElement("File_Area_Observational");
@@ -501,7 +511,7 @@ namespace Isis {
    OutputLabel(oLabel);
    oLabel.close();
    
    ofstream oCube(outputFile.expanded().toLatin1().data());
    ofstream oCube(imageName.toLatin1().data());
    StartProcess(oCube);
    oCube.close();

+4 −1
Original line number Diff line number Diff line
@@ -68,6 +68,9 @@ namespace Isis {
   *                           Array_3D_Image values properly.
   *   @history 2017-11-21 Kristin Berry - Updated the constructor to add the xml version and 
   *                           encoding to the beginning of the XML file.
   *   @history 2018-02-05 Kristin Berry - Updated WritePds4 to remove the .xml and add a .img
   *                           if the user inputs something of the form filename.xml as the image
   *                           output name. 
   */

  class ProcessExportPds4: public Isis::ProcessExport {