is it possible to decompress an mmpz file without lmms --dump?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

is it possible to decompress an mmpz file without lmms --dump?

Andy Kelley
My failed attempts:

$ gunzip 1-blank.mmpz
gzip: 1-blank.mmpz: unknown suffix -- ignored

$ zcat 1-blank.mmpz

gzip: 1-blank.mmpz: not in gzip format

$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import zlib
>>> zlib.decompress(open('1-blank.mmpz', 'rb').read())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
zlib.error: Error -3 while decompressing data: unknown compression method


It looks like the file is compressed with qCompress() and qDecompress() with the default compression setting, which means that the above should work!


--
Andy Kelley
http://superjoesoftware.com/

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel
Reply | Threaded
Open this post in threaded view
|

Re: is it possible to decompress an mmpz file without lmms --dump?

Tobias Doerffel-2
Hi,

Am Freitag, 4. Juni 2010, um 14:54:09 schrieb Andy Kelley:
> My failed attempts:
>
> $ gunzip 1-blank.mmpz
> gzip: 1-blank.mmpz: unknown suffix -- ignored
>
> $ zcat 1-blank.mmpz
lmms -d blank.mmpz > blank.mmp


> It looks like the file is compressed with qCompress() and qDecompress()
> with the default compression setting, which means that the above should
> work!
Almost.. 4 bytes of data length are prepended:

http://doc.trolltech.com/4.6/qbytearray.html#qUncompress

Toby

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: is it possible to decompress an mmpz file without lmms --dump?

Andy Kelley-2
"If you want to use this function to uncompress external data compressed using zlib, you first need to prepend four bytes to the byte array that contain the expected length"

I want to do the opposite - uncompress data compressed using qCompress().

I don't want to have to have lmms installed to do it

On Fri, Jun 4, 2010 at 6:04 AM, Tobias Doerffel <[hidden email]> wrote:
Hi,

Am Freitag, 4. Juni 2010, um 14:54:09 schrieb Andy Kelley:
> My failed attempts:
>
> $ gunzip 1-blank.mmpz
> gzip: 1-blank.mmpz: unknown suffix -- ignored
>
> $ zcat 1-blank.mmpz
lmms -d blank.mmpz > blank.mmp


> It looks like the file is compressed with qCompress() and qDecompress()
> with the default compression setting, which means that the above should
> work!
Almost.. 4 bytes of data length are prepended:

http://doc.trolltech.com/4.6/qbytearray.html#qUncompress

Toby

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel




--
Andy Kelley
http://superjoesoftware.com/

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel
Reply | Threaded
Open this post in threaded view
|

Re: is it possible to decompress an mmpz file without lmms --dump?

Martin Andrews (LMMS)
On 4 June 2010 09:08, Andrew R Kelley <[hidden email]> wrote:
> "If you want to use this function to uncompress external data compressed
> using zlib, you first need to prepend four bytes to the byte array that
> contain the expected length"
>
> I want to do the opposite - uncompress data compressed using qCompress().
>
> I don't want to have to have lmms installed to do it

(On Linux) : Strip off the first four bytes first :

$ tail --bytes=+4 | uncompress -c - > outputfilename.uncompressed

(or something along those lines).

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel
Reply | Threaded
Open this post in threaded view
|

Re: is it possible to decompress an mmpz file without lmms --dump?

Kevin-276
In reply to this post by Andy Kelley
This works:

lmms -d inputfile.mmpz > output.mmp

http://lmms.sourceforge.net/wiki/index.php?title=Developer_FAQ

-Octosquidopus


On Fri, Jun 4, 2010 at 08:54, Andy Kelley <[hidden email]> wrote:
My failed attempts:

$ gunzip 1-blank.mmpz
gzip: 1-blank.mmpz: unknown suffix -- ignored

$ zcat 1-blank.mmpz

gzip: 1-blank.mmpz: not in gzip format

$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import zlib
>>> zlib.decompress(open('1-blank.mmpz', 'rb').read())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
zlib.error: Error -3 while decompressing data: unknown compression method


It looks like the file is compressed with qCompress() and qDecompress() with the default compression setting, which means that the above should work!


--
Andy Kelley
http://superjoesoftware.com/

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel
Reply | Threaded
Open this post in threaded view
|

Re: is it possible to decompress an mmpz file without lmms --dump?

Andy Kelley
yeah but then my project is dependent on LMMS, Qt, and a dozen other libs.

On Fri, Jun 4, 2010 at 6:19 AM, Kevin <[hidden email]> wrote:
This works:

lmms -d inputfile.mmpz > output.mmp

http://lmms.sourceforge.net/wiki/index.php?title=Developer_FAQ

-Octosquidopus


On Fri, Jun 4, 2010 at 08:54, Andy Kelley <[hidden email]> wrote:
My failed attempts:

$ gunzip 1-blank.mmpz
gzip: 1-blank.mmpz: unknown suffix -- ignored

$ zcat 1-blank.mmpz

gzip: 1-blank.mmpz: not in gzip format

$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import zlib
>>> zlib.decompress(open('1-blank.mmpz', 'rb').read())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
zlib.error: Error -3 while decompressing data: unknown compression method


It looks like the file is compressed with qCompress() and qDecompress() with the default compression setting, which means that the above should work!


--
Andy Kelley
http://superjoesoftware.com/

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel





--
Andy Kelley
http://superjoesoftware.com/

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel
Reply | Threaded
Open this post in threaded view
|

Re: is it possible to decompress an mmpz file without lmms --dump?

Tobias Doerffel-2
In reply to this post by Andy Kelley
Hi,

Am Freitag, 4. Juni 2010, um 14:54:09 schrieb Andy Kelley:
> >>> import zlib
> >>> zlib.decompress(open('1-blank.mmpz', 'rb').read())
(bash) tail -c+5 foo.mmpz > foo
(python) zlib.decompress(open('foo', 'rb').read())

works for me :)

Toby

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: is it possible to decompress an mmpz file without lmms --dump?

Andy Kelley-2
Hey me too!

Thanks Toby.

On Fri, Jun 4, 2010 at 6:22 AM, Tobias Doerffel <[hidden email]> wrote:
Hi,

Am Freitag, 4. Juni 2010, um 14:54:09 schrieb Andy Kelley:
> >>> import zlib
> >>> zlib.decompress(open('1-blank.mmpz', 'rb').read())
(bash) tail -c+5 foo.mmpz > foo
(python) zlib.decompress(open('foo', 'rb').read())

works for me :)

Toby

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel




--
Andy Kelley
http://superjoesoftware.com/

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel