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
Re: Issue loading TIFF images with plugin/TIF [message #59526 is a reply to message #59523] Tue, 17 January 2023 10:56 Go to previous messageGo to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

There is another issue reading the following TIFF image with plugin/TIF using e.g. examples/ImageView:

https://www.marinha.mil.br/chm/sites/www.marinha.mil.br.chm/ files/geotiff/1511geotiff.zip

A large area in the center of the image gets black. (E.g. Windows built-in photo viewer shows the image correctly.)

This can be fixed in tifupp.cpp FetchPage():
...
bool TIFRaster::Data::FetchPage()
{
	if(page_error)
		return false;
	if(page_fetched)
		return true;

	cache_size = 0;
	rows.Clear();
	int64 bytes = row_bytes * (int64)height;
/*	if(bytes >= 1 << 28) { 					// << Commenting this out fixes the issue with 1511geotiff.tif
		tmpfile = GetTempFileName();
		if(!filebuffer.Open(tmpfile, FileStream::CREATE)) {
			page_error = true;
			return false;
		}
		filebuffer.SetSize(bytes);
		if(filebuffer.IsError()) {
			filebuffer.Close();
			FileDelete(tmpfile);
			page_error = true;
			return false;
		}
		rows.Alloc(size.cy);
	}
	else
*/		imagebuf.SetCount(size.cy * row_bytes, 0);
...


However, I think there is (or has been) some reason to use tmpfile for big images...

Best regards,

Tom
 
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: Fri May 10 05:14:23 CEST 2024

Total time taken to generate the page: 0.02390 seconds