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 » Image::GetDPI() doesn't return Size(0, 0)
Image::GetDPI() doesn't return Size(0, 0) [message #59673] Wed, 01 March 2023 11:13 Go to next message
Mountacir is currently offline  Mountacir
Messages: 45
Registered: November 2021
Member
Hi,

Trying to check if an image has DPI using Image::GetDPI() but it does not return Size(0, 0) if it doesn't have it, while ImageBuffer::GetDPI() does.

	FileSelNative fs;
	fs.Type("png","*.png;*.png");
	if(!fs.ExecuteOpen()) return;
	
	Image image = StreamRaster::LoadFileAny(~fs);
	DUMP(image.GetDPI());

index.php?t=getfile&id=6781&private=0


Thanks
  • Attachment: dpi_0.png
    (Size: 1.84KB, Downloaded 127 times)
  • Attachment: test_image.zip
    (Size: 542.91KB, Downloaded 42 times)
Re: Image::GetDPI() doesn't return Size(0, 0) [message #59678 is a reply to message #59673] Wed, 01 March 2023 16:04 Go to previous messageGo to next message
cgokdemir is currently offline  cgokdemir
Messages: 12
Registered: February 2023
Location: TURKEY
Promising Member
Hi,
I opened the sample image with irfanview and looked at the image properties.
The DPI settings seem empty, maybe you want to try with a different image.

Kind regards.


Windows 10 Home 64bit
Re: Image::GetDPI() doesn't return Size(0, 0) [message #59679 is a reply to message #59673] Wed, 01 March 2023 16:43 Go to previous message
Mountacir is currently offline  Mountacir
Messages: 45
Registered: November 2021
Member
Hi cgokdemir,

Yes, that image has no DPI property, i want to detect that then give it an appropriate DPI.
Normally Windows will give images with no DPI a DPI of 96, and Photoshop gives them 72 DPI.
Previous Topic: Issue loading TIFF images with plugin/TIF
Next Topic: BufferPainter Clip Crash - Fatal error: Invalid memory access!
Goto Forum:
  


Current Time: Fri Mar 29 15:27:21 CET 2024

Total time taken to generate the page: 0.01569 seconds