PureZIP library : ZIP / UNZIP files
Moderator: gnozal
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
If I add with PureZip a archives file (ZIP or JCalG1) to my ZIP-archives, it's every time corrupted (not valid archives) after extracting.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
No problems here.Thorsten1867 wrote:If I add with PureZip a archives file (ZIP or JCalG1) to my ZIP-archives, it's every time corrupted (not valid archives) after extracting.
Do you use the latest purebasic beta libraries ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
PureBasic v4.00 (Windows - x86) - Build Date: 05/09/2006 - 23:26:02gnozal wrote:Do you use the latest purebasic beta libraries ?
PureBasic_4_00_(xz7xhz).exe
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I mean the libraries from http://www.purebasic.com/betaThorsten1867 wrote:PureBasic v4.00 (Windows - x86) - Build Date: 05/09/2006 - 23:26:02gnozal wrote:Do you use the latest purebasic beta libraries ?
PureBasic_4_00_(xz7xhz).exe
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
No, I will download it.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Now it seems to work. THANKS!!!!!
If tried to solve the problem many hours and were full of despair.

If tried to solve the problem many hours and were full of despair.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
No problem.Thorsten1867 wrote:Now it seems to work. THANKS!!!!!![]()
If tried to solve the problem many hours and were full of despair.
http://www.purebasic.fr/english/viewtop ... &start=115
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I don't know.wilbert wrote:Is it possibly to use the ImagePluginPNG library to compress data in memory ?
You cannot use PureZIP and ImagePluginPNG together in the same project.wilbert wrote:I only need the PureZIP_PackMemory functionality from the PureZIP library but since this library doesn't work together with the ImagePluginPNG library and PNG encoding also requires zlib compression I was wondering this.
They both use a static ZLIB library ; I don't know what to do to avoid the POLINK error. Maybe Fred knows ...
What you can do :
- use another image plugin
- use the ZLIB DLL (look at Num3's web site).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Remainder
In order to use PureZIP for PB4 without errors, you need the latest beta libairies from http://www.purebasic.com/beta because of a purebasic bug in the file library (ReadData()/Eof() bug : http://www.purebasic.fr/english/viewtopic.php?t=22186)
References :
- http://www.purebasic.fr/english/viewtop ... c&start=44
- http://www.purebasic.fr/english/viewtop ... highlight=
Thanks.
In order to use PureZIP for PB4 without errors, you need the latest beta libairies from http://www.purebasic.com/beta because of a purebasic bug in the file library (ReadData()/Eof() bug : http://www.purebasic.fr/english/viewtopic.php?t=22186)
References :
- http://www.purebasic.fr/english/viewtop ... c&start=44
- http://www.purebasic.fr/english/viewtop ... highlight=
Thanks.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
User request :
Update V1.60 (both libs)
Changes :
- added : new function PureZIP_SetCompressionAlgorithm()
Update V1.60 (both libs)
Changes :
- added : new function PureZIP_SetCompressionAlgorithm()
PureZIP_SetCompressionAlgorithm()
Syntax
PureZIP_SetCompressionAlgorithm(Algorithm.l)
Description
Set current compression algorithm.
Algorithms
#Z_NO_COMPRESSION : no compression (store)
#Z_DEFLATED : deflate algorithm
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Joining memory blocks into one ZIP file
I need to create an entry in a ZIP archive that is the concatenation of two areas of memory plus a block of zeros.
When writing to a normal binary file the following code does the job:
I have successfully used 'PureZIP_AddMemory()' to save a block of memory but am unsure how to acheive the same as the binary file example, as above.
It would be difficult to build a single image by copying/creating the three parts because one of them could be many hundreds of MBytes in size.
Any suggestions are most welcome.
When writing to a normal binary file the following code does the job:
Code: Select all
If CreateFile(1,SFile$) ; Open the new file
WriteData(*FileImage,*StartOfLOG) ; Always write the SPAD,TIF and TSDB areas
WriteData(*A,*B-*A) ; Write the specified range of data from the LOG
For n.w=0 To 130 ; Write a tailpiece to ensure correct decoding
WriteLong(0)
Next
CloseFile(1)
MessageRequester("D_Log","Saved <"+SFile$+">")
Else
MessageRequester("D_Log","Could not save Log File")
EndIf
It would be difficult to build a single image by copying/creating the three parts because one of them could be many hundreds of MBytes in size.
Any suggestions are most welcome.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: Joining memory blocks into one ZIP file
My suggestion :RichardL wrote:I need to create an entry in a ZIP archive that is the concatenation of two areas of memory plus a block of zeros.
First you need to create a new memory block, that is the concatenation of the two areas of memory plus a block of zeros.
Second, use PureZIP_AddMemory() or PureZIP_Archive_CompressMem() to add the new block to your ZIP file.
If you can't create a new block in memory (not enough memory?), create a new temporary file that is the the concatenation of the two areas of memory plus a block of zeros, then add this temp file to the ZIP file with PureZIP_AddFile() or PureZIP_Archive_Compress(), and finaly delete the temp file.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Hi Gnozal,
I have already taken the second route you suggested, using the binary file as the intermediate file. On consideration it was the only way to go.
The project involves reading telemetry data from memory cards... last year the cards were 64MByte and I could read them all into memory without problems. This year 512M cards, up to half full. Next year up to 100% full and the year after we move to 1GB or 2GB cards.
I have already taken the second route you suggested, using the binary file as the intermediate file. On consideration it was the only way to go.
The project involves reading telemetry data from memory cards... last year the cards were 64MByte and I could read them all into memory without problems. This year 512M cards, up to half full. Next year up to 100% full and the year after we move to 1GB or 2GB cards.