[Implemented] zlib upgrade from V1.2.3 to 1.2.6

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

[Implemented] zlib upgrade from V1.2.3 to 1.2.6

Post 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
Fredi
Enthusiast
Enthusiast
Posts: 143
Joined: Wed Jul 23, 2008 10:45 pm

Re: zlib upgrade from V1.2.3 to 1.2.6

Post by Fredi »

+1
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: zlib upgrade from V1.2.3 to 1.2.6

Post 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.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: zlib upgrade from V1.2.3 to 1.2.6

Post by skywalk »

The zlib Adler32 function has also been improved, but not sure anybody uses that instead of crc32.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: zlib upgrade from V1.2.3 to 1.2.6

Post 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
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: zlib upgrade from V1.2.3 to 1.2.6

Post by ts-soft »

The upgrade is for nothing good!
PB doesn't require this upgrade, if you require it, import the new lib :wink:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: zlib upgrade from V1.2.3 to 1.2.6

Post by Guimauve »

Ok suggesting a library upgrade it's bad idea.

Best regards anyway.
Guimauve
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: zlib upgrade from V1.2.3 to 1.2.6

Post 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
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: zlib upgrade from V1.2.3 to 1.2.6

Post 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
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

Re: zlib upgrade from V1.2.3 to 1.2.6

Post by Thorium »

So, just replace the lib. I dont see the problem.
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: zlib upgrade from V1.2.3 to 1.2.6

Post 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
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

Re: zlib upgrade from V1.2.3 to 1.2.6

Post 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.
xorc1zt
Enthusiast
Enthusiast
Posts: 276
Joined: Sat Jul 09, 2011 7:57 am

Re: zlib upgrade from V1.2.3 to 1.2.6

Post 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
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: zlib upgrade from V1.2.3 to 1.2.6

Post 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
Last edited by Guimauve on Wed Feb 22, 2012 9:14 pm, edited 2 times in total.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: zlib upgrade from V1.2.3 to 1.2.6

Post by skywalk »

Hi Guimauve,
0.1% = 1.001 :wink:

Code: Select all

CompressedLength = Round(1.001 * UnCompressedLength,#PB_Round_Up) + 12
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply