jmon Posted August 24, 2012 Share Posted August 24, 2012 (edited) Hi everyone,How to get the image dimension of 32 bits and floating point images?this returns weird values , like 4294967295 for the width and 0 for height :#Include <GDIPlus.au3> $theFile = "C:\Image.tga" _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile ( $theFile ) $iWidth = _GDIPlus_ImageGetWidth ( $hImage ) $iHeight = _GDIPlus_ImageGetHeight ( $hImage ) _GDIPlus_ImageDispose ( $hImage ) _GDIPlus_Shutdown() ConsoleWrite ( "Image Dimensions = " & $iWidth " * " & $iHeight & @CRLF )Same issue with Targa (.tga) images 32bits.Open EXR Sample images : Sample Images for download[EDIT1]Just wanted to add that this doesn't work either : [EDIT2]Solved using freeimage. Edited August 24, 2012 by jmon [center]www.jmontserrat.comFile Sequence UDF - _StringExtractPaths - _StringTrimPattern - GuiCtrlSetOnTop - CalendarUDF[/center] Link to comment Share on other sites More sharing options...
jmon Posted August 24, 2012 Author Share Posted August 24, 2012 OK,I found the solution: Using the function _FreeImage_GetWidth and GetHeight, freeimage supports also HDR files and many other kind of image types.Thanks everyone. [center]www.jmontserrat.comFile Sequence UDF - _StringExtractPaths - _StringTrimPattern - GuiCtrlSetOnTop - CalendarUDF[/center] Link to comment Share on other sites More sharing options...
UEZ Posted August 24, 2012 Share Posted August 24, 2012 Exr image format is not supported by GDI+ and that's the reason why you get strange values. $hImage = _GDIPlus_ImageLoadFromFile ( $theFile ) If @error Then Exit MsgBox(16, "ERROR", "File couldn't be loaded") should help to see whether image format is supported or not. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
jmon Posted August 24, 2012 Author Share Posted August 24, 2012 Yes, I tried already, and _GDIPlus_ImageGetType returns -1 on EXR files. I think -1 is $GDIP_IMAGETYPE_UNKNOWN But I am still open for other alternatives to freeImage, because I find it a bit slow compared to the speed of GDIPlus on jpg images. [center]www.jmontserrat.comFile Sequence UDF - _StringExtractPaths - _StringTrimPattern - GuiCtrlSetOnTop - CalendarUDF[/center] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now