New version of PNG library (now v3.2.q)
-
- Posts: 2428
- Joined: Jul 19, 2006 19:17
- Location: Sunnyvale, CA
- Contact:
Maybe you already have the DLL and don't want it, but if anyone does want it:
http://freefile.kristopherw.us/uploads/ ... /zlib1.dll
:)
http://freefile.kristopherw.us/uploads/ ... /zlib1.dll
:)
Newer versions of freebasic come with an old version of the PNG lib already included and the compiler uses those versions in preference to the ones in your project code - you may need to overwrite the existing ones with the newer version or just delete it from the library and inc folders so that the compiler is forced to use the ones in the project directory.
That is not 100% true. A few versions ago on the WIN32 SVN I forgot that I had installed PNG lib in my FB directory. I had installed a version that was on my thumbdrive, and it was VERY old. I was informed of this, and updated the version I had in my directory, so the newest SVN downloads I provide have the latest version of the LIB.I would remove it, but I have not yet found a SIMPLE way to still use the LIB without it being in my FB directories. If anyone can give me a hint, I will remove it all together from the SVN downloads to make things simpler.
-
- Posts: 2428
- Joined: Jul 19, 2006 19:17
- Location: Sunnyvale, CA
- Contact:
You can put the .a file and DLL in the project folder, as with any other library. If you put the .a file in a subfolder of your project folder, you can use #libpath.Imortis wrote:That is not 100% true. A few versions ago on the WIN32 SVN I forgot that I had installed PNG lib in my FB directory. I had installed a version that was on my thumbdrive, and it was VERY old. I was informed of this, and updated the version I had in my directory, so the newest SVN downloads I provide have the latest version of the LIB.I would remove it, but I have not yet found a SIMPLE way to still use the LIB without it being in my FB directories. If anyone can give me a hint, I will remove it all together from the SVN downloads to make things simpler.
Hey, didn't mean to impugn your builds, I appreciate them very much! =P Allow me to correct myself, then! Since the standalone version of pnglib is different to the regular version that is included in your build the compiler will by default use the .dll dependent version included with freebasic rather than the standalone version in the project directory. At least - that's my experience.Imortis wrote:That is not 100% true. A few versions ago on the WIN32 SVN I forgot that I had installed PNG lib in my FB directory. I had installed a version that was on my thumbdrive, and it was VERY old. I was informed of this, and updated the version I had in my directory, so the newest SVN downloads I provide have the latest version of the LIB.I would remove it, but I have not yet found a SIMPLE way to still use the LIB without it being in my FB directories. If anyone can give me a hint, I will remove it all together from the SVN downloads to make things simpler.
In regards to using pnglib outside of your FB directory, I've honestly never had any trouble with just putting
Code: Select all
#define PNG_STATICZ 1
#include Once "fbpng.bi"
-
- Posts: 12
- Joined: Jul 01, 2007 20:17
- Location: Poland
I think that there is an error in png_dimensions function's.
Error will appear when czi will be 509 or something around.
That's because png file should be closed after successfully read of dimensions.
Now png_dimensions look like this:
But it should like this:
Strange I can't write PM :>
ps. great library :-)
Code: Select all
#include "file.bi"
#Include "fbpng.bi"
Dim As UInteger xu, yu, czi
For czi = 1 To 1000
png_dimensions(ExePath & "\test.PNG", xu, yu)
If Not FileExists(ExePath & "\test.PNG") Then Print czi & " - error!": Exit For
Next
That's because png file should be closed after successfully read of dimensions.
Now png_dimensions look like this:
Code: Select all
w = get_u32( @tmp1 )
h = get_u32( @tmp2 )
end sub
Code: Select all
w = get_u32( @tmp1 )
h = get_u32( @tmp2 )
fclose( hfile )
end sub
ps. great library :-)