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 » Community » Newbie corner » some jpgs don't open & slow Stream to Raster
Re: some jpgs don't open & slow Stream to Raster [message #57661 is a reply to message #57654] Sun, 14 November 2021 16:48 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Ausin2029 wrote on Thu, 11 November 2021 00:31
Hi,

In the process of learning Ultimate++ I'm tying to make a small GUI tool to resize images. I studied the tutorials/examples and search the forum and managed to load the images I want to resize in ColumnList, but I have two problems so far:

1- Some .jpg images don't open even with the ImageView example, but they open fine with the TheIde & the IconDes including its Filesel Preview ( & its WhenIconLazy after i removed the .icon size restriction).

2- The images loading/showing is so slow, I think the bottleneck happens when the Stream is converted back to Image.

The code I come up with:


void imageresizer::openimages(){
	
	if(!fs.ExecuteOpen()) return;

	int fslen = fs.GetCount();

	
	work.Run([=] {

		for(int i =0; i < fslen ; i++) {
			
			String fn = fs[i];

			Image img = StreamRaster::LoadFileAny(fn);			

				GuiLock __;				
				
				if(IsNull(img)) {

					Exclamation(DeQtf(fn) + " not an image.");
					
				}
					
				else {
				
					ClmList.Add(i, img, true);

				}
		}

	});

}



I would appreciate any help or guidance.

Thanks you
Austin2029


Code seems fine.

Generally, loading especially high resolution .jpgs can be somewhat slow (we are victims of jpg library we are using here). I usually solve the problem with delayed loads / displays (which in general is not trivial to implement).

Can you upload some examples of .jpgs not loading in ImageView?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to migrate my old packages to new version U++ in linux
Next Topic: Single tags HTML parser
Goto Forum:
  


Current Time: Tue Jun 11 21:55:27 CEST 2024

Total time taken to generate the page: 0.01802 seconds