Hi, I am trying to compress a image (.png) using hexadecimal and ZLIB. 
When running the below code within naviserver the created file is larger then 
if I run standalone shell. 

The sample code is as follows: 
######### 
set file "/bench/myImage.png" 
set filePath "/bench/" 

set myFile [open $file RDONLY] 
fconfigure $ myFile -translation binary 
set content [read $ myFile ] 
set binData [encoding convertto utf-8 $content] 
set hexData [binary encode hex [encoding convertto utf-8 $content]] 
close $ myFile 

set fp [open "$filePath/myCompressedHexBlobFile.ixz" w] 
puts $fp [zlib compress $hexData] 
close $fp 
######### 
Outputs: 
846K - myImage.png 
1.7M - myCompressedHexBlobFile.ixz - Executed within Naviserver 
1.1M - myCompressedHexBlobFile.ixz - Executed from shell with TCLSH 
######### 
Is Navi using a different zlib compression level, why is this happening? 
If I set the compression level to nine, the created file is still at 1.7mb. 
This is kind of a game changer, even if I source the compression script the 
file size is still larger then if I run it via terminal. 

Thanks 
Fox 




_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to