iOS/Objective-C read 4GB or greater of Zipped archive library? - iphone

I have tried using:
Objective-Zip
ZipKit
Both say they have the capability of reading 4GB or larger zipped archives. Has anyone successfully been able to read very larged zipped content using one of the libraries mentioned above?
If you know a better zipped archive library, please let me know.

I ran into the same problem and trying to solve it over couple of days.
Finally, i solved it.
With my instruction you can unzip big files (even 8GB) in iOS without any problems.
This is an step-by-step instruction how to solve it:
1) Download Objective-Zip from https://github.com/flyingdolphinstudio/Objective-Zip
2) Download MiniZip from https://github.com/nmoinvaz/minizip
3) Take 4 files - ioapi.c, ioapi.h, unzip.c, unzip.h - from minizip folder (which you downloaded in step 2) and paste it to the Objective-Zip/MiniZip folder (override files).
4) Go to Objective-Zip/Objective-Zip/ZipFile.m and replace this string
int err= unzLocateFile(_unzFile, [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], 1);
to this
int err= unzLocateFile(_unzFile, [fileNameInZip cStringUsingEncoding:NSUTF8StringEncoding], (unzFileNameComparer)1);
5) Finally, add Objective-Zip to your project and happy unzipping! :)
Now you can unzip big files in iOS. I checked on 8GB-zip, everything works like a charm!
P.S.: developer of Objective-Zip will update it with my fix as soon as possible, so this instruction is actual for Objective-Zip 0.8.1 only.

As long the zip library supports PKWare's ZIP64 extension then it should be able to work with large files over 4GB.
Objective-Zip uses minizip 1.1 which supports ZIP64.
ZipKit website states it supports ZIP64 extension.
Both these libraries should work. I have experience with minizip 1.1 and I know for certain that it supports large files.

Related

How to cross compile tesseract ocr engine for iphone?

I am struggling from past 1 week that how to compile the tesseract ocr enging for iphone. I have gon through through some link, But i couldn't find the proper way. Can anyone help me through step by step procedure. Thanks in advance.
I will have to agree with you on this that it is not an easy task, but the below links finally helped me achieve this... hoping this helps..
http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/
http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/
That probably won't be enough. I know nothing about Tesseract OCR library but you will require the include directives, plus specify the directory to where the Tesseract header files are installed via a compiler switch (usually -I) and (possibly) link with the Tesseract library file(s).
That would be enough to compile the sources if the header files are installed into common include directories. However, if the header files do not contain the definitions (not just declarations) for all functions/variables then there will be a library file(s) (like libtesseract.a or/and libtesseract.so) that must be linked in order to compile your binary.

How do I zip a folder on the iPhone

I have seen a lot of related questions but none really helped.
I'm trying to create a zip archive from a folder (on the iPhone).
The structure of the folder is the following:
In this example the zip would be "folderToBeZipped.zip"
What is the easiest way to accomplish this and how do I unzip it (also iPhone) later on?
Maybe you can find this project useful
http://code.google.com/p/ziparchive/

FFMpeg for iPhone

I am trying to create an app that will allow me to stream video FROM the iPhone TO a server. my current theory as to how to do this is to create a series of FFMpeg files and send them to the server. as far as i can tell i have compiled the FFMpeg library correctly for the iPhone.
i followed these instructions here. a series of executable files appeared in the folder so i'm assuming it worked.
my question is now what? how do i get these into an app? how do i make calls to these executable files? and most importantly will this even work the way i want it to?
You have built the ffmpeg binary which can run on an iPhone. You cannot run executables from an app on a (non-jailbroken) phone. So you would have to compile the library, and link against that. Then, from your app, call the relevant functions directly, mimicing what the ffmpeg program does.
Althought this issue is quite old this could help to other users in the future:
Just take a look at the source code here http://dev.wunderground.com/support/wunderradio/wunderradio.1.9lgpl.zip
Good luck
Ok you said that you succesfully compiled FFMpeg for iPhone, right? As mvds said, you can't use them as executable files. So in order to use this libraries after compilation finishes you need to copy all the .a libs generated to your project (as when you add libraries or other frameworks). These libraries are:
libavcodec.a
libavfilter.a
libavutil.a
libswscale.a
libavdevice.a
libavformat.a
libswresample.a
Then you have to configure your project
Clic on your project -> build settings
Search "Header Search Paths" and add the folder location of your libraries (location can be absolute or relative)
Clic on build phases -> Link Binary With Libraries -> Add other, and add all .a files
Voila! Now you can import and use the libraries of FFmpeg for your project
#include <avcodec.h>
#include ...
// More C and/or Objective-C Code
To access individual uncompressed frames you can use captureOutput:didOutputSampleBuffer:fromConnection: delegate method from AVCaptureVideoDataOutput (there are plenty of examples), and somehow encoding them to h264 maybe using AVFrame? As far as I know FFmpeg also can stream using RTSP for live streaming, but it seems that documentation is close to zero :(
To answer your final question
and most importantly will this even work the way i want it to?
The answer is yes, it can work, I found 2 libraries that do just what you want to achieve
http://www.foxitsolutions.com/iphone_h264_sdk.html
http://ios-rtmp-library.com
Both uses FFmpeg the same way you are suggesting, this question is a little old but I have found many users trying to achieve this so so I have a question Do you had success on doing this? Can you share your experience or recomendations?

zlib directly for uncompressing a zip folder for iphone

Is it possible to use the bare minimum zlib available on iPhone to uncompress a zip of a folder. I don't want to go for a open source library, please enlighten me the difficulty or possibility of implementing one piece of code which can uncompress a zip file.
As JosephH said, you cannot use ZLib to deal with .zip files.
But you can use the MiniZip library for that: http://www.winimage.com/zLibDll/minizip.html
There's already an Objective-C wrapper, if you don't want to write yours: http://code.google.com/p/ziparchive/
FYI - ZLib on iPhone:
Adds libz to the linked frameworks of your main target, just as another framework.
Then, you can check the ZLIB tutorials, to learn how to compress/decompress a file: http://www.zlib.net/zlib_how.html
zlib does not directly support the .zip file format, sorry.
It can be done though, contrib/minizip in the zlib distribution provides an example. (link to code: http://cvsweb.xfree86.org/cvsweb/utils/zlib/contrib/minizip/miniunz.c?rev=1.1&content-type=text/vnd.viewcvs-markup )
I'm unsure why you're against open source libraries, but
http://bitbucket.org/kolpanic/zipkit/wiki/Home is a great solution.

Loading external .bundles on iPhone

I would like to add resource files to a .bundle and push them to my application and it seems to work fine in the simulator but fails to build when I change to the device.
/Users/sosborn/Projects/MyPro/build/Debug-iphoneos/FooBar.bundle:
object file format invalid or
unsuitable
I don't want to load any code or anything, just plain text and jpegs and it would be nice to be able to package them as dependencies.
iPhones and iPod touchs do not have support for loading external modules (neither bundles nor dylibs). If you need to share object code between projects, you can use static libraries
Instead of trying to load it like an NSBundle, just reference the resources therein by path.
You could pretty easily create your own class that did something similar to the non-code stuff in NSBundle to help out, as there really isn't much logic in there.
I found a better solution to my problem. It actually doesn't require the use of bundles at all. I just created an aggregate target instead of a bundle target. Then I added a copy step and a script step. The copy step contains all of the resources I had in the bundle target and the script step actually zips up the files. Then when I download the content into my application I can just unzip it and use it just as if it were a bundle since I'm just storing resource dependencies.
Thanks for your help.