Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Issue loading TIFF images with plugin/TIF
Issue loading TIFF images with plugin/TIF [message #59517] Fri, 13 January 2023 17:44 Go to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Mirek,

I get a crash when loading certain TIFF -images with plugin/TIF. (I'm testing with U++ examples/ImageView.) Debugger takes me to gtTileContig() in tif_getimage.c:
    if (flip & FLIP_HORIZONTALLY) {
	    uint32 line;

	    for (line = 0; line < h; line++) {
		    uint32 *left = raster + (line * w);
		    uint32 *right = left + w - 1;
		    
		    while ( left < right ) {
			    uint32 temp = *left;
			    *left = *right;
			    *right = temp;
			    left++;
				right--;
		    }
	    }
    }

The problem is that 'raster' is a null pointer already when TIFFRGBAImageGet() is called from tifupp.cpp.
bool res = TIFFRGBAImageGet(this, 0, width, height);


Crashing depends on the filling order of the image and associated flipping thereof.

I have attached a sample set of GeoTIFF images (downloaded from the internet many years ago) that are readable if I comment out the flipping code. However, they obviously load in whatever orientation they like.

Could you please look at this issue, clear the crash and hopefully also solve the problem with orientation? The way 'TIFFRGBAImageGet' is used here is a bit too fascinating for me to handle.

BTW: I must say that I was both surprised and very pleased when I discovered that plugin/TIF internally supported GeoTIFF tags in such a clean and elegant manner. I'm hoping to replace my old GeoTIFF reader with plugin/TIF now.

Thanks and best regards,

Tom

EDIT: Please note that the attached data set also includes files with name tp_image*.tif using some old proprietary Intergraph tag 33918 and associated packets. I'm not expecting to support those old non-standard parts of intergraph files. However, it would be nice to be able to deal with the TIFFTAG_GEOTIEPOINTS tag even without TIFFTAG_GEOPIXELSCALE using the associated mappings.

Additionally it would be useful to store the data in GeoKeys as metadata. I mean something like attr.GetAdd("ProjectedCSTypeGeoKey") = Value((int)epsgcode); and equivalent for all found GeoKeys. This would enable extending handling of specific files without further changes to plugin/TIF.

[Updated on: Sat, 14 January 2023 22:28]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: BufferPainter Text Clips all text when partial off screen
Next Topic: Image::GetDPI() doesn't return Size(0, 0)
Goto Forum:
  


Current Time: Sat Apr 27 19:15:54 CEST 2024

Total time taken to generate the page: 0.05375 seconds