Skip to content
Snippets Groups Projects
Commit 1bd1db26 authored by Jonathan Guinet's avatar Jonathan Guinet
Browse files

TEST: test to reproduce CentOS problem with GDAL linked with old libTIFF version.

parent dbb5443d
No related branches found
No related tags found
No related merge requests found
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbStreamingImageFileWriter.h"
#include "itkCastImageFilter.h"
/**
* This test reproduces a problem encountered with CentOS5.5 using 3.8.2 libTIFF version
* Issue number 0000437
*/
int main(int argc, char* argv[])
{
if (argc != 3)
{
std::cout << argv[0] << " <input image> <output image>" << std::endl;
return EXIT_FAILURE;
}
typedef otb::Image<unsigned short, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::StreamingImageFileWriter<ImageType> WriterType;
typedef itk::CastImageFilter<ImageType, ImageType> CastFilterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
reader->Update();
CastFilterType::Pointer caster = CastFilterType::New();
caster->SetInput( reader->GetOutput() );
caster->InPlaceOn();
WriterType::Pointer writer = WriterType::New();
writer->SetInput(caster->GetOutput());
writer->SetFileName(argv[2]);
//writer->SetAutomaticTiledStreaming(1024);
writer->WriteGeomFileOn();
writer->SetTileDimensionTiledStreaming(256);
writer->Update();
return EXIT_SUCCESS;
}
......@@ -295,7 +295,10 @@ ADD_TEST(FA-0000436-WrapperInputImage_GetImage ${CXX_TEST_PATH}/0000436-WrapperI
${INPUTDATA}/scene_8.tif
)
ENDIF(BUILD_APPLICATIONS)
# ------- FA 0000437-WriteImageCentOS -------------------------
ADD_TEST(FA-0000437-WriteImageCentOS ${CXX_TEST_PATH}/0000437-WriteImageCentOS
${BASELINE}/FA-0000437-WriteImageCentOSInput.tif
${TEMP}/FA-0000437-WriteImageCentOSOutput.tif)
# ------- Vectorization issue -----------------------------------
# FIXME Desactivated until http://bugs.orfeo-toolbox.org/view.php?id=94
......@@ -358,4 +361,7 @@ IF(BUILD_APPLICATIONS)
TARGET_LINK_LIBRARIES(0000436-WrapperInputImage_GetImage OTBApplicationEngine)
ENDIF(BUILD_APPLICATIONS)
ADD_EXECUTABLE(0000437-WriteImageCentOS 0000437-WriteImageCentOS.cxx)
TARGET_LINK_LIBRARIES(0000437-WriteImageCentOS OTBIO OTBCommon)
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment