Skip to content
Snippets Groups Projects
Commit c872067c authored by Andreas Schenk's avatar Andreas Schenk
Browse files

changed tiff io to only write positive origins (negative origins are...

changed tiff io to only write positive origins (negative origins are unfortunately not supported by the tiff library)
parent 2d54c1a0
Branches
Tags
No related merge requests found
......@@ -311,7 +311,7 @@ void MapIOTiffHandler::do_export(const img::MapHandle& image,TIFF* tfile,TIF& fo
img::Point ori=image.GetSpatialOrigin();
geom::Vec3 sampling=image.GetPixelSampling();
float xreso=sampling[0]/Units::cm,yreso=sampling[1]/Units::cm;
float xpos=xreso*ori[0],ypos=yreso*ori[1];
float xpos=std::max<Real>(0.0,xreso*ori[0]),ypos=std::max<Real>(0.0,yreso*ori[1]); //tiff file format only allows positivie origins, negative origins are lost here
TIFFSetField(tfile,TIFFTAG_IMAGEWIDTH,width);
TIFFSetField(tfile,TIFFTAG_IMAGELENGTH,height);
TIFFSetField(tfile,TIFFTAG_SAMPLESPERPIXEL,spp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment