Jump to content

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


jmon
 Share

Recommended Posts

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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...