FreeImage (lib) ImageHeight?
BlitzPlus Forums/BlitzPlus Programming/FreeImage (lib) ImageHeight?
| ||
Is there any way to find the image height and width using images loaded by freeimage? This is the only thing standing in my way to victory! Hehe, I appreciate the help. |
| ||
images 'loaded' by freeimage??? |
| ||
I really love/hate the guy who made the FreeImage Lib and named it ... FreeImage. I propose a renaming promptly, as to avoid any other confusion. "FreeImage" is a user made library of image loading and saving functions for JPG, TGA, TIF, etc. FreeImage, the function, I am aware, release the pictures from memory. |
| ||
Hiya, The commands you are after should be: Width=FI_GetWidth(FIBITMAP) Height=FI_GetHeight(FIBITMAP) I will be updating this lib eventually, just busy with ProPixel at the moment. |
| ||
Oh, are they already in there? and thank you for the reply! Where can I get the latest version? |
| ||
Yup, already in there. If you check the decls file you can see all the commands I've wrapped already. Download the latest FreeImage from Here. Just overwrite the dll with this one. :) |
| ||
/me bows down to Snarty. You rock out loud! |
| ||
Ok, it got it to save out the TIFF file, but the tif saved has no preview, and cannot be opened with photoshop. Any idea what i did wrong? The JPG BMP and PNG are the only ones that seem to save out right for me. I switch to TIFF and TGA, and I get the same results. Invalid files. Thanks! |
| ||
Nevermind, I think I fixed it. The FreeImage.bb I had this in it. Function SaveTIFF(Image, File$, Compression=TIFF_NONE) ; Compression ; TIFF_PACKBITS = save using PACKBITS compression ; TIFF_DEFLATE = save using DEFLATE compression ; TIFF_ADOBE_DEFLATE = save using ADOBE DEFLATE compression ; TIFF_NONE = save without any compression (DEFAULT) If Image FIBITMAP=FIQSend(Image) Suc=FI_Save(FIF_TARGA,FIBITMAP,File$,Compression) FI_Unload FIBITMAP If Not Suc Notify "TIFF Save Failed"+Chr(10)+File$ Else RuntimeError "Image Instance Not Found (TIFF Save)" EndIf End Function So, I changed the FIF_TARGA to FIF_TIFF and it seemed to have worked. |
| ||
ahh, yeah, my fault. There were still a few issues in the lib before I was cut from the net. But, now I'm back I'll revisit the lib and ensure it caters for the latest FreeImage dll and also iron out any issues. I'm pleased you found the issue though. |
| ||
I thank you a lot for creating this library! Glad I could get it sorted out too. I was able to finish my program and it works beautifully thanks to you! All it does is crop and scale images, but the kind of images was the key :D Thanks again! |