Page 1 of 2
[Implemented] zlib upgrade from V1.2.3 to 1.2.6
Posted: Mon Feb 20, 2012 3:38 pm
by Guimauve
Hello everyone,
The zlib currently available in PureBasic is the version 1.2.3 (18-07-2005). According to the [ur=
http://zlib.net/l]zlib web site[/url] the last version is 1.2.6 (29-01-2012).
An almost 7 years outdated lib, maybe an upgrade it's not a luxury.
Best regards.
Guimauve
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Tue Feb 21, 2012 10:09 pm
by Fredi
+1
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Tue Feb 21, 2012 10:31 pm
by ts-soft
-1
Fred wrote:From the zlib page: "Version 1.2.5 fixes bugs in gzseek() and gzeof() that were present in version 1.2.4 (March 2010). All users are encouraged to upgrade immediately. "
That's one of the reasons why we don't rush on new libs. You may be not know, but using a new version of a lib in PB isn't as easy as it seems. We can't update the whole third libs every now and then, we do it if a PB command is clearly affected with it, or when it's too old. Many (most) softwares still run perfectly with old libs, of course. That's not because a new version is released than older software suddenly stop working...
http://www.purebasic.fr/english/viewtop ... 56#p322056
For what is this good? PB doesn't use anything from new version!
Better a old but stable version without problem, as a new one.
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Tue Feb 21, 2012 11:06 pm
by skywalk
The zlib Adler32 function has also been improved, but not sure anybody uses that instead of crc32.
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 12:46 am
by Guimauve
ts-soft wrote:For what is this good? PB doesn't use anything from new version!
Better a old but stable version without problem, as a new one.
Sorry but I totally disagree about this. Pay attention, I don't ask to rush to upgrade all libraries the millisecond they are available but the zlib is almost not 7 minutes, 7 hours, 7 days, 7 weeks, 7 months but 7 YEARS late.
If I follow your logic, the V1.2.6 just arrive we don't rush to upgrade we let the to become mature. But by the time the PureBasic upgrade arrive a new version just arrive so the upgrade will be cancelled because the newer version, not the 1.2.6 but the 1.2.7 is not mature. Months pass, another time to upgrade, unfortunately it's a newer version, the V1.2.8 the upgrade is cancelled one more time.
In ten thousand years from now,
Fred wrote:Hey guys, I will upgrade the zlib, the version is now V10000000.2.9 I thinks is time to do it. AH ! to bad the newer version is out, the 10000000.3.0, sorry I will wait until this lib will become stable
Maybe an upgrade per year is fair.
Best regards.
Guimauve
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 12:52 am
by ts-soft
The upgrade is for nothing good!
PB doesn't require this upgrade, if you require it, import the new lib

Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 2:05 am
by Guimauve
Ok suggesting a library upgrade it's bad idea.
Best regards anyway.
Guimauve
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 2:14 am
by ts-soft
Guimauve wrote:Ok suggesting a library upgrade it's bad idea.
This is not right. A upgrade of zlib, only internal used from pb is not a good idea,
only if some of the PB libs requires this or a security issue.
A upgrade of SQLite3 is usefull. The pb-users can use new function in sql,
without using of API. This make sense
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 3:20 am
by Guimauve
I suggesting an update for the zlib because the internal Packer library based on jCalG1 allow compressing/decompressing data if the file is going stay on the same platform. If you want to create a compressed file on Windows and decompress it on Linux it didn't work. So, a library creating a compressed data file platform depend is completely useless. This is why I have re-created the Packer library using the zlib, see here :
http://www.purebasic.fr/english/viewtop ... 12&t=46469
I already importing function from this library including the
compressBound(UnCompressedLenght.l) function witch is know to be bugged in version 1.2.3 fixed in version 1.2.4 but this version has a serious bug so all people using it should upgrade again to V1.2.5. So I need to find the way my self to calculate the "compressBound" to allocate the proper memory block. It's very frustrating to re-invent the wheel just because the library is little bit out of date.
Anyway it up to Fred/Freak now.
Best regards.
Guimauve
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 4:17 am
by Thorium
So, just replace the lib. I dont see the problem.
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 1:51 pm
by Guimauve
Thorium wrote:So, just replace the lib. I dont see the problem.
Can someone tell me if this lib is used by PureBasic some how ?
I don't want to screwed up the PNG Encoder/Decoder just to be able to compress files and data.
Best regards.
Guimauve
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 6:17 pm
by Thorium
Guimauve wrote:
Can someone tell me if this lib is used by PureBasic some how ?
It's only used for encoding and decoding PNG files. It should be replaceable without a problem.
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 6:26 pm
by xorc1zt
ts-soft wrote:-1
Fred wrote:From the zlib page: "Version 1.2.5 fixes bugs in gzseek() and gzeof() that were present in version 1.2.4 (March 2010). All users are encouraged to upgrade immediately. "
That's one of the reasons why we don't rush on new libs. You may be not know, but using a new version of a lib in PB isn't as easy as it seems. We can't update the whole third libs every now and then, we do it if a PB command is clearly affected with it, or when it's too old. Many (most) softwares still run perfectly with old libs, of course. That's not because a new version is released than older software suddenly stop working...
http://www.purebasic.fr/english/viewtop ... 56#p322056
For what is this good? PB doesn't use anything from new version!
Better a old but stable version without problem, as a new one.
upgrading your libs is not only about new functions but also about bugs fix, better performances and security issues.
as you can see
here, zlib got a lot of changes since 1.2.3
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 6:33 pm
by Guimauve
xorc1zt wrote:as you can see
here, zlib got a lot of changes since 1.2.3
And this is why it's not a good idea to wait very long before to upgrade a library. The work load can become tremendous. It my point of view about this.
By the way, I have create a patch to avoid the use of bugged command from the V1.2.3
Code: Select all
CompressedBufferSize = (Int(1.1 * UnCompressedBufferSize) + 12)
That it's !
Best regards
Guimauve
Re: zlib upgrade from V1.2.3 to 1.2.6
Posted: Wed Feb 22, 2012 7:57 pm
by skywalk
Hi Guimauve,
0.1% = 1.001
Code: Select all
CompressedLength = Round(1.001 * UnCompressedLength,#PB_Round_Up) + 12