-
Notifications
You must be signed in to change notification settings - Fork 58
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
Filesize estimate #11
Conversation
in the ZipArchive process function you had a bug. It was calling the ->finish() method which was resetting the archive options. Causing the estimation of the size to change. The ZipSizePredictionFailed event was possibly raised/omitted under certain conditions. |
@jszobody please review so we can move forward |
@jszobody Please review. |
I'm out of town this whole week at a business conference with limited availability. I don't expect to be able to really focuse on this until next week. Have you built zips with this new code and tested them on both Windows and Mac? I seem to remember having issues with the zeroHeader option, I think Mac Finder couldn't open the zip? I don't remember for sure. |
Thank you for the update. |
@Firtzberg I meant to ask you: do the improvements in this PR to filesize prediction properly handle Zip64 now? I previously just avoided zip size prediction if the size of an individual file or the total zip size was greater than 32 bit. I didn't understand enough about zip headers in Zip64 to know how that is calculated. laravel-zipstream/src/Models/File.php Line 173 in 4ed0277
laravel-zipstream/src/ZipStream.php Line 308 in 4ed0277
If you believe filesize prediction now works with Zip64, I'll remove these checks. |
I don't know. I wondered about this myself. I had a look at the ZIP format specification. I think the underlying ZipStream-PHP package doesn't handle this properly itself. If it does it does it in a very hard to read manner. Anyway I thought how to test this? I think the only way to do it is to generate a large zip file. |
Aight see #13 |
Improves estimation of file sizes and resulting zip stream.
Accurate estimation requires the Archive options to be provided. therefore the FileContract was modified.