Sign in to follow this  
Followers 0
jmon

How to get image dimension of floating point and 32bit images? [SOLVED]

4 posts in this topic

#1 ·  Posted (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 by jmon

Share this post


Link to post
Share on other sites



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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0