New version of PNG library (now v3.2.q)

User projects written in or related to FreeBASIC.
vdecampo
Posts: 2982
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Postby vdecampo » Jun 29, 2009 0:59

No go. I get this error...

Image

-Vince
KristopherWindsor
Posts: 2428
Joined: Jul 19, 2006 19:17
Location: Sunnyvale, CA
Contact:

Postby KristopherWindsor » Jun 29, 2009 3:03

Maybe you already have the DLL and don't want it, but if anyone does want it:
http://freefile.kristopherw.us/uploads/ ... /zlib1.dll
:)
vdecampo
Posts: 2982
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Postby vdecampo » Jun 29, 2009 3:06

So does this mean that I cannot statically link the library? What is the purpose of #define PNG_STATICZ 1?

-Vince
1000101
Posts: 2556
Joined: Jun 13, 2005 23:14
Location: SK, Canada

Postby 1000101 » Jun 29, 2009 22:06

You can statically link the the png library, but without specifying that it will still link to zlib.dll instead of the static zlib.
vdecampo
Posts: 2982
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Postby vdecampo » Jun 29, 2009 22:55

1000101 wrote:You can statically link the the png library, but without specifying that it will still link to zlib.dll instead of the static zlib.


So why am I getting that error message??!!! This is really getting confusing! :(

-Vince
1000101
Posts: 2556
Joined: Jun 13, 2005 23:14
Location: SK, Canada

Postby 1000101 » Jul 01, 2009 10:22

Bug in the png source?
GuideBot
Posts: 4
Joined: Aug 18, 2008 23:52

Postby GuideBot » Jul 02, 2009 9:01

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.
Imortis
Moderator
Posts: 1629
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Postby Imortis » Jul 02, 2009 11:13

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.
KristopherWindsor
Posts: 2428
Joined: Jul 19, 2006 19:17
Location: Sunnyvale, CA
Contact:

Postby KristopherWindsor » Jul 03, 2009 3:56

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.

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.
GuideBot
Posts: 4
Joined: Aug 18, 2008 23:52

Postby GuideBot » Jul 03, 2009 8:31

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.

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"


near the top of my main .bas file and the libfbpng.a and png_image.bi files in the same directory - seems to work OK. What error do you get?
Imortis
Moderator
Posts: 1629
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Postby Imortis » Jul 03, 2009 16:11

KristopherWindsor hit the nail on the head. I will have pnglib removed from the next release.
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Postby agamemnus » Jul 08, 2009 0:28

Q: How do I assign a color scheme to a 1 bit png image?
dreamerman
Posts: 12
Joined: Jul 01, 2007 20:17
Location: Poland

Postby dreamerman » Nov 18, 2009 10:49

I think that there is an error in png_dimensions function's.

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

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:

Code: Select all

w = get_u32( @tmp1 )
h = get_u32( @tmp2 )
end sub

But it should like this:

Code: Select all

w = get_u32( @tmp1 )
h = get_u32( @tmp2 )
fclose( hfile )
end sub

Strange I can't write PM :>
ps. great library :-)
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » Nov 26, 2009 11:24

Thanks dreamerman, yes that is a bug, I will update the code in the next version.
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Postby yetifoot » Dec 05, 2009 9:51

First post updated with new version v1.9.3

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 50 guests