Closed iori57 closed 9 years ago
You can reduce the framework size by including only one code slice, this is how they get away with 4-7MB apps in the past.
But I think the answer to your question is paradoxically to increase the size of framework by adding bitcode, using this method: http://stackoverflow.com/questions/30722606/what-does-enable-bitcode-do-in-xcode-7
In the future, bitcode will most probably be mandatory for all App Store apps. It already is for apps with watch extensions. App Store will take care of executable size when we get bitcode included in the framework. End user will only get 'slices' of the code appropriate for their device, thus solving the issue at the source.
Related to #185
How to perform slicing for the TesseractOCR.framework? Currently I'm just using command line to build the TesseractOCR.framework file following the topic https://github.com/gali8/Tesseract-OCR-iOS/issues/128 and I'm not sure how to slice it using this approach. Thanks!
I'm uploading the patch with botched support. Pls, refer to the linked ticket. But I'm not sure it can help you. It seems that bitcode increases the binary 3 times more.
More specifically to your question, I think the total weight of the app depends on the number of the functions used in it. I mean, perhaps, those 3Mb apps used only recognition function. Instead you app uses much more functionality like PDF output or something, that's why much more code is linked to your app to support those functionality. Furthermore, tessdata files are very heavy and may increase the weight significantly. Finally, the tesseract now is linked with libtiff, libpng, libjpg to support PDF output of the tesseract. I believe that those libraries shouldn't be linked if you don't use any of the functionality, but it should be ensured.
@iori57, can you tell us the size of your app so far and compare it with the archived template executable from the repository?
My app size is now 34.6MB, which consists of..
I included English language pack for the convenience of users.
What I did is I drag the whole TesseractOCR.framework file (after building it with command line) to my Project and choose 'Copy if necessary', after that under 'Link Binary with Libraries' I click on the + sign and added it there.
I only use the recognition function and nothing else so far, the whole framework seems to be included. I'm not linking libtiff, libpng, libjpg too.
Seems like the whole framework is included because I'm linking it incorrectly?
Thanks for listening!
I apologize. The huge app size was not due to TesseractOCR.framework. I tried changing the .ipa file to .zip, extract it out to check what is actually taking up the spaces, to my surprise the huge file size was actually due to my English Language pack bundle having duplicates in the same package (probably due to bad referencing). I'm closing the issue now, but feel free to add on.
Thanks!
iOS noob here.. sorry if the question sounds silly.
The whole framework file is 17MB, after packaging with my app the whole app becomes more than 20MB which I think is a little bit huge.. how can we reduce the size of this file? Or is there a way to create a binary of Tesseract which is much smaller which can be used in our app?
I know it is possible because I've seen many apps that uses Tesseract OCR engine both on iPhone and Android with the app size of only 4-7 MB (if they don't bundle any language packs within).
Thanks!