zlib 64 bit

  1. last week

    Chellappan P

    Nov 7 Pre-Release Testers, Xojo Pro

    I am using RB-zlib (zlib binding) from Boredom Software.
    I am using the built in zlib in Mac OS X 10.10.5
    When I build a 32 bit application and execute it, I get a "Incompatible Version" error
    Any pointers ?
    The error occurs in the following routine

    Sub Constructor(CompressionLevel As Integer = zlib.Z_DEFAULT_COMPRESSION, CompressionStrategy As Integer = zlib.Z_DEFAULT_STRATEGY, Encoding As Integer = zlib.DEFLATE_ENCODING, MemoryLevel As Integer = zlib.DEFAULT_MEM_LVL)
    ' Construct a new Deflater instance using the specified compression options.
    ' If the deflate engine could not be initialized an exception will be raised.

    // Calling the overridden superclass constructor.
    // Constructor() -- From zlib.FlateEngine
    Super.Constructor()

    If CompressionStrategy <> Z_DEFAULT_STRATEGY Or Encoding <> DEFLATE_ENCODING Or MemoryLevel <> DEFAULT_MEM_LVL Then
    ' Open the compressed stream using custom options
    mLastError = deflateInit2_(zstruct, CompressionLevel, Z_DEFLATED, Encoding, MemoryLevel, CompressionStrategy, zlib.Version, zstruct.Size)

    Else
    ' process zlib-wrapped deflate data
    mLastError = deflateInit_(zstruct, CompressionLevel, zlib.Version, zstruct.Size)

    End If

    If mLastError <> Z_OK Then Raise New zlibException(mLastError)
    mLevel = CompressionLevel
    mStrategy = CompressionStrategy
    End Sub

  2. Andrew L

    Nov 7 San Francisco, CA, USA

    64 bit builds are not yet supported. The error coming from zlib is the result of a size mismatch for a shared data structure. The zlibx64 branch fixes the mismatch and a few other showstoppers but still in an experimental stage.

  3. Martin T

    Nov 7 Pre-Release Testers Germany
    Edited last week

    I did a short test on your zlibx64. I use your library with the latest Xojo under macOS 10.14.1, 64-Bit and got the following error message: "The zlib library is a different version than what was expected."

  4. Andrew L

    Nov 7 San Francisco, CA, USA

    It's expecting zlib version 1.2.8. What version do you have? Some Googling suggests that OS X ships version 1.2.3.

  5. Martin T

    Nov 7 Pre-Release Testers Germany

    I didn't use an external zlib version. So could be that you are right that the built-in macOS version is 1.2.3

  6. 7 days ago

    Christian S

    Nov 8 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    MBS Xojo Compression Plugin has Zip classes: ZLibCompressMBS and ZLibDecompressMBS .
    Compiled for all targets and easy to use.

  7. 6 days ago

    Chellappan P

    Nov 8 Pre-Release Testers, Xojo Pro

    Is there any way of installing zlib version 1.2.8 in Mac OSX 10.10.5 ?

  8. Chellappan P

    Nov 8 Pre-Release Testers, Xojo Pro

    Does the MBS Xojo Compression Plugin package have examples of how to inflate and deflate pdf streams ?

  9. Hi Chellapan,

    yes you can install the latest zlib with Homebrew (https://brew.sh ). However, to my knowledge, be aware that it will not be installed in /usr/local/lib because it may cause bad interferences with the System zlib. Instead, it would be installed somewhere in /usr/local/Cellar and you will have to explicitly indicate the full path in your Xojo project.

  10. Jean-Yves P

    Nov 8 Pre-Release Testers, Xojo Pro Europe (France, Besançon)
    Edited 6 days ago

    example of zlib usage with realstudio (old)
    https://github.com/declaresub/zlib_rb
    still opens and compiles fine under xojo 2018r3

  11. Chellappan P

    Nov 8 Pre-Release Testers, Xojo Pro

    Hi Jean,
    I need to do Flate encoding and decoding.
    The example at https://github.com/declaresub/zlib_rb does not seem to do that.
    Or am I missing something here ?

  12. Christian S

    Nov 8 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    @ChellappanPalaniappan Does the MBS Xojo Compression Plugin package have examples of how to inflate and deflate pdf streams ?

    Well, for PDF, we just let DynaPDF do that in our plugin.
    The global function here should simply do that:

    CompressZLibMBS (buf as string, level as integer) as string
    CompressZLibMBS (buf as string, level as integer, byref error as integer) as string
    DecompressZLibMBS (buf as string, size as integer) as string
    DecompressZLibMBS (buf as string, size as integer, byref error as integer) as string

  13. 5 days ago

    Chellappan P

    Nov 9 Pre-Release Testers, Xojo Pro

    I tried CompressZLibMBS and DecompressZLibMBS functions and it worked fine in both Mac and Win.
    How does one determine the size parameter in the decompress function ?
    It probably is n times the input string. Any thumb rule for determining 'n' ?

  14. Christian S

    Nov 9 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Well, this assumes you know the size from compress.
    Or just guess it.

    I thought about doing a version which doesn't need the output size.

  15. Chellappan P

    Nov 9 Pre-Release Testers, Xojo Pro

    I know the length of the compressed string. I thought a factor of 2 or 3 should be sufficient.
    Is my assumption right ?
    I think a version which does not require the output size makes more sense.
    Is it possible to get it in the near future ?

  16. Christian S

    Nov 9 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Let me just check if I can add it today.
    You can email me for a download Link later.

  17. 2 days ago

    Chellappan P

    2 days ago Pre-Release Testers, Xojo Pro

    Could you finish the changes ?

  18. Christian S

    2 days ago Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Yes, done already.

  19. yesterday

    Chellappan P

    yesterday Pre-Release Testers, Xojo Pro

    Can I download it directly from your website ?

  20. Christian S

    yesterday Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    I wrote: You can email me for a download Link later.

or Sign Up to reply!