-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trying to use libarchivejs to decode a pure bzip2 stream #25
Comments
Hi,
Thanks for getting back to me. We are using the file API but the decode
doesn't work - we assume it's because libarchivejs needs a "archive
wrapper" around the bzip2 file. Are we missing something simple?
Here's the code:
async decompressLibarchivejsFromFile() {
let vm = this;
this.decompressLibarchivejs(<File>this.files[0], vm); // this is what
we get from an input type = file
}
async decompressLibarchivejs(file: File | Blob, vm: CompressionTest) {
let archive = await Archive.open(file);
let date1 = Date.now();
archive.extractFiles(entry => {
let date2 = Date.now();
vm.messages.push(`Decompressed ${entry.path} ${entry.file.size} bytes
in ${date2-date1}ms`);
let link = document.createElement('a');
link.href = window.URL.createObjectURL(entry.file);
link.download = entry.path;
link.click();
window.URL.revokeObjectURL(link.href);
});
}
*Paul de Goede *
Chief Technology Officer
[image: cid:[email protected]]
<http://www.portfoliometrix.com/>
*Mobile*
+27 82 941 5151 <%2B27829415151>
*Office*
+27115683400
*E-mail*
[email protected]
*Address*
Corner Main Office Park, 2 Payne Road, Bryanston, South Africa
<https://goo.gl/maps/hvnBeC1jVmF2>
*Website*
www.portfoliometrix.com
PortfolioMetrix Asset Management Ltd is authorised and regulated by the
Financial Conduct Authority (FCA) in the United Kingdom. PortfolioMetrix
(Pty) Ltd is an Authorised Financial Services Provider in South Africa.
This e-mail and any files transmitted with it may contain information which
is private, legally privileged, proprietary in nature, or otherwise
protected by law from disclosure and is intended only for the use of the
addressee(s). If you are not the intended recipient you are hereby notified
that reading, copying or distributing this message is strictly prohibited.
If you have received this electronic mail message in error, please contact
the sender immediately by return email, facsimile or telephone and take the
steps necessary to delete the message, attachment(s) if any, and all copies
thereof completely from your computer system. Any views, opinions,
conclusions or other information presented in this email are solely those
of the author and do not necessarily represent those of PortfolioMetrix.
Although all reasonable precautions have been taken to ensure that this
email is virus-free, we accept no liability for any loss or damage caused
by any virus transmitted by this email or its attachments.
…On Fri, 14 Feb 2020 at 10:51, ნიკა ***@***.***> wrote:
you could create File object first
https://developer.mozilla.org/en-US/docs/Web/API/File/File
and use libarchivejs afterwards
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AHFGOY7T6ORKRO3AFS25TD3RCZLQ7A5CNFSM4KVDM3VKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELYBQBY#issuecomment-586160135>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHFGOYZK6BRJCO7F2NB5T5TRCZLQ7ANCNFSM4KVDM3VA>
.
|
Hi,
Just as a clear example I've attached a bzip2 file (bz2.txt). Libarchivejs
can't decompress this but if you download the bzip2 gnu utility (
http://prdownloads.sourceforge.net/gnuwin32/bzip2-1.0.5-bin.zip?download).
You can:
bzip2.exe -d -v c:\Users\PauldeGoede\Downloads\bz2.txt
Rename output file to .pdf and you can see it's a pdf document that a pdf
reader can open.
Libarchivejs can't handle this.
*Paul de Goede *
Chief Technology Officer
[image: cid:[email protected]]
<http://www.portfoliometrix.com/>
*Mobile*
+27 82 941 5151 <%2B27829415151>
*Office*
+27115683400
*E-mail*
[email protected]
*Address*
Corner Main Office Park, 2 Payne Road, Bryanston, South Africa
<https://goo.gl/maps/hvnBeC1jVmF2>
*Website*
www.portfoliometrix.com
PortfolioMetrix Asset Management Ltd is authorised and regulated by the
Financial Conduct Authority (FCA) in the United Kingdom. PortfolioMetrix
(Pty) Ltd is an Authorised Financial Services Provider in South Africa.
This e-mail and any files transmitted with it may contain information which
is private, legally privileged, proprietary in nature, or otherwise
protected by law from disclosure and is intended only for the use of the
addressee(s). If you are not the intended recipient you are hereby notified
that reading, copying or distributing this message is strictly prohibited.
If you have received this electronic mail message in error, please contact
the sender immediately by return email, facsimile or telephone and take the
steps necessary to delete the message, attachment(s) if any, and all copies
thereof completely from your computer system. Any views, opinions,
conclusions or other information presented in this email are solely those
of the author and do not necessarily represent those of PortfolioMetrix.
Although all reasonable precautions have been taken to ensure that this
email is virus-free, we accept no liability for any loss or damage caused
by any virus transmitted by this email or its attachments.
On Fri, 14 Feb 2020 at 10:57, Paul de Goede <
[email protected]> wrote:
Hi,
Thanks for getting back to me. We are using the file API but the decode
doesn't work - we assume it's because libarchivejs needs a "archive
wrapper" around the bzip2 file. Are we missing something simple?
Here's the code:
async decompressLibarchivejsFromFile() {
let vm = this;
this.decompressLibarchivejs(<File>this.files[0], vm); // this is what
we get from an input type = file
}
async decompressLibarchivejs(file: File | Blob, vm: CompressionTest) {
let archive = await Archive.open(file);
let date1 = Date.now();
archive.extractFiles(entry => {
let date2 = Date.now();
vm.messages.push(`Decompressed ${entry.path} ${entry.file.size}
bytes in ${date2-date1}ms`);
let link = document.createElement('a');
link.href = window.URL.createObjectURL(entry.file);
link.download = entry.path;
link.click();
window.URL.revokeObjectURL(link.href);
});
}
*Paul de Goede *
Chief Technology Officer
[image: ***@***.***
<http://www.portfoliometrix.com/>
*Mobile*
+27 82 941 5151 <%2B27829415151>
*Office*
+27115683400
*E-mail*
***@***.***
*Address*
Corner Main Office Park, 2 Payne Road, Bryanston, South Africa
<https://goo.gl/maps/hvnBeC1jVmF2>
*Website*
www.portfoliometrix.com
PortfolioMetrix Asset Management Ltd is authorised and regulated by the
Financial Conduct Authority (FCA) in the United Kingdom. PortfolioMetrix
(Pty) Ltd is an Authorised Financial Services Provider in South Africa.
This e-mail and any files transmitted with it may contain information which
is private, legally privileged, proprietary in nature, or otherwise
protected by law from disclosure and is intended only for the use of the
addressee(s). If you are not the intended recipient you are hereby notified
that reading, copying or distributing this message is strictly prohibited.
If you have received this electronic mail message in error, please contact
the sender immediately by return email, facsimile or telephone and take the
steps necessary to delete the message, attachment(s) if any, and all copies
thereof completely from your computer system. Any views, opinions,
conclusions or other information presented in this email are solely those
of the author and do not necessarily represent those of PortfolioMetrix.
Although all reasonable precautions have been taken to ensure that this
email is virus-free, we accept no liability for any loss or damage caused
by any virus transmitted by this email or its attachments.
On Fri, 14 Feb 2020 at 10:51, ნიკა ***@***.***> wrote:
> you could create File object first
> https://developer.mozilla.org/en-US/docs/Web/API/File/File
> and use libarchivejs afterwards
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#25?email_source=notifications&email_token=AHFGOY7T6ORKRO3AFS25TD3RCZLQ7A5CNFSM4KVDM3VKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELYBQBY#issuecomment-586160135>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHFGOYZK6BRJCO7F2NB5T5TRCZLQ7ANCNFSM4KVDM3VA>
> .
>
BZh31AY&SYÑQ© .õÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáˆ?v¾á�¾€õ½öí3ÍO·vëïºwß|óÝßu}Ǽ÷)=º²KÜk¼û÷o¼{g½Ã_Lìè÷·Ï¹ß|{ÏkM÷Þïi¶ñÎÙöûï»ç}½{·ºÞ·¯}ßwß>ç×½÷«cv¦¾ö{jäõé.ÍÝ÷>{—¯{æ^ÚJïowUï>½Õ3ouÍV·Lû{ÞôÏ=Ë=¾ éÙïÛî Zß}í:ßwmîú:¯îϾöŒë�»{:^ëâöçÞÏ_jëÇ»zÕ=ë¾Ýöò–Ÿ6ûåº;w½÷M½ž-{ãÜØ 39ï½ð¾ßg ï¯_>o€€{ºõë™àïv—·ßŽ}½wƒîãß=ðÒ}}çÛÞ[»ï¼»Ðùìû·¶õñº÷¾^û¹—ÛÝó™ÒûÆûÞî›Ý½»Ôlû¦Ó—[Û{»º{ßW»Ç_oŽÞçݺ¥Þ﬽v½œõ÷»löí5ôûí{ÝÝ÷=ïyöï�ÞW®ãëèo·^÷ovm�{ºïwŸxϾ»Øž³}½÷Ýïm7ƒßô¯{ºg�Ž¾÷pŸowNûw¶ûi}zÇͼ¶ÆöÕu¶¡K˯¼Ö¾ûÝî·³Þ|ݾlÓïO¼ÖûèŸ[Ý÷nVÎÞß
ÝyÝÞ÷¯¢½xÛ€¸÷=ï ×d}‡}›ÙñÞ¹ÛíïážvÏkêŽÖ·«ÅÞëî·»í÷½¾g{S½ÝÖÞl±Ï[Ýìë¾¾½Ù¼Ð_=ß}÷}±zÞ€-«ºÞ÷»î/·ÏvæÙßméw}Q×gÂwÊîܾö÷×Çß}ß4Ʀg×ß{Þîǽï}ö÷ÝMkK±¾Þì²ÞÞß{xß7o{Ü÷Øë¯&XûÞÛÎÖÚ-¶omEiÛº>÷]¼÷mó½Úî¸÷Û|Ý·>{¹Ûìßm¾Ýöîâê´Ù-Üiï½w¦ãºöîŸ{ÝO¾ï«Öß>ó”{o^÷>÷ͽ}îÞ÷×}VÛÝõ÷ßl}=»w™æëÝîçÝyµõÕ³éß{é}}u×gË·ké|ø_;žÏyÇufïo/wuï»'wsœ½íësËëï½÷]¾ÎúÏGÝÛïv²zÓéZ�ÞæÝÝí£›uïnÙvÄú2ðµŒ÷8ºlï»ÎºÞÊ·qïK˽µ³lÞëk¦¹ÙkÓµ{»ëº»ëé÷“í×}Û{]¾×o£îë'Ï«±}fû:öûïyyß^ÏhÝ[èïo]÷znõéºoKž·…íÓzuìoIÝÞíåA+{½ìë;ÝÑ·sCÞmö÷Zï9Úûºíß9nçží×½º{Ïn�Ìóí_WÛO/·[{9ÏgÝï»�õ½÷9÷ŽO|¾K{unÝåîókÛy>íô{Zí�¶ÓÐ8G}ÅÖ÷¾÷Þè^ËgWf¨;&§Ý»Ø×ѧ·]ï¾rëëżrto¶FÝîîÞôõ§}šö7Þ{î}ß5öúç{mÖûyoyï7½è�KßVzmŽõ÷;Mw½z½÷lö÷ßq|ëݯrùé{}ÊÙÛîïnêÎmµïßktu¾÷wNö>Þæëßo½îÏž·¾º^¯µ}ŸzöÞç[ï8öe½í÷Þ{ÞO[>;UYÖõ½æ÷Ûßkçv&ûï}{o·ÅJ & & “Ä`)àL&
|
Hi @nika-begiashvili , Would you be able to assist us in this regard? We are happy to compensate for time. You can email me directly on [email protected] Thanks |
I've taken a look and I think it's possible, we would need to expose https://github.com/libarchive/libarchive/wiki/FormatRaw functionality, I'll do some experimentation in near future |
Thanks! Looking forward to it. Happy to help with test cases etc. Let me know how we can assist. |
Do you have any sense of if/when this functionality would be available? |
Hi,
We have a stream/byte array which doesn't have an archive wrapper (i.e. it's not wrapped in a zip archive - it's just a bzip2 compressed file). How can we use libarchivejs to decompress this stream/byte array?
The text was updated successfully, but these errors were encountered: