Page 12 of 40
Posted: Mon Aug 07, 2006 11:36 am
by Thorsten1867
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.
Posted: Mon Aug 07, 2006 1:29 pm
by gnozal
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.
No problems here.
Do you use the latest purebasic beta libraries ?
Posted: Mon Aug 07, 2006 1:34 pm
by Thorsten1867
gnozal wrote:Do you use the latest purebasic beta libraries ?
PureBasic v4.00 (Windows - x86) - Build Date: 05/09/2006 - 23:26:02
PureBasic_4_00_(xz7xhz).exe
Posted: Mon Aug 07, 2006 1:48 pm
by gnozal
Thorsten1867 wrote:gnozal wrote:Do you use the latest purebasic beta libraries ?
PureBasic v4.00 (Windows - x86) - Build Date: 05/09/2006 - 23:26:02
PureBasic_4_00_(xz7xhz).exe
I mean the libraries from
http://www.purebasic.com/beta
Posted: Mon Aug 07, 2006 1:52 pm
by Thorsten1867
No, I will download it.
Posted: Mon Aug 07, 2006 2:02 pm
by Thorsten1867
Now it seems to work. THANKS!!!!!
If tried to solve the problem many hours and were full of despair.
Posted: Mon Aug 07, 2006 2:07 pm
by gnozal
Thorsten1867 wrote:Now it seems to work. THANKS!!!!!
If tried to solve the problem many hours and were full of despair.
No problem.
http://www.purebasic.fr/english/viewtop ... &start=115
Posted: Sat Aug 26, 2006 7:11 am
by wilbert
Is it possibly to use the ImagePluginPNG library to compress data in memory ?
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.
Posted: Sat Aug 26, 2006 7:49 am
by gnozal
wilbert wrote:Is it possibly to use the ImagePluginPNG library to compress data in memory ?
I don't know.
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.
You cannot use PureZIP and ImagePluginPNG together in the same project.
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).
Posted: Fri Sep 15, 2006 3:10 pm
by gnozal
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.
Posted: Fri Sep 22, 2006 4:27 pm
by gnozal
User request :
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
Posted: Fri Sep 22, 2006 6:49 pm
by GeoTrail
Great work gnozal, as usual

Joining memory blocks into one ZIP file
Posted: Sat Sep 23, 2006 9:17 am
by RichardL
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:
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
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.
Re: Joining memory blocks into one ZIP file
Posted: Sat Sep 23, 2006 1:30 pm
by gnozal
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.
My suggestion :
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.
Posted: Sat Sep 23, 2006 4:44 pm
by RichardL
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.