ZXing multiple QR code scanning from single image iOS - iphone

Is it possible to scan multiple qr codes from a single image ? If so how can I implement it ? I have a requirement to scan all qr codes from the single image..

In the svn trunk, there's support for multiple QR codes in QRCodeMultiReader. Not sure what you're using on the iPad but (the widget or the objc library) but it should be pretty easy to tie the QRCodeMultiReader in to those.

The Java version of zxing, which is the main version, contains support for reading multiple barcodes in one image. Look at MultipleBarcodeReader. You'd have to port it, but, it's not that hard.

Related

Dynamic Version Numbering in a Default.png

I have a Default.png which includes a version number on it. Every time I update my app, I have to change it both in the lite and full version's default.png and default#2x.png. Hassle, no?
I'm pretty sure I've been going about this the wrong way. What should I do instead? (I would like to show a version number on launch, not just nix it altogether.)
Compile-Time Image Compositing
If your logo doesn't need to change other than the version number, then you can use your graphics library of choice at compile-time to refactor the png. Pseudo code below:
Pseudo-Code:
UpdateLogo(String logoName, String version)
{
WidgetImage MyLogo(logoName + ".png");
MyLogo.DrawText(800, 650, version);
MyLogo.Write(logoName + "Final.png");
}
UpdateLogo("Logo.png", "Version 1.0.0");
Compile that program and keep it around as a custom build tool. Then whenever you need to build your application you can compile Logo.png into LogoFinal.png. If you need help using XCode or other tools to generate image files I suggest you search for image manipulation tools separately from "dynamic versioning".
Ideally your version string will use constants defined in an easily-editable table or controlled by your build system. At the very least it will save you from opening up Photoshop every time you need to build your app.
For Display in a Running Application
You should be using a font to draw the version number on top of the logo. Then you can just include a resource file that is text-based and can be easily updated by automated tools for each build.
Sources
Can you create custom build rules for XCode based on file type?
Apple's Human Interface Guidelines say that the Default.png shouldn't be used as a splash screen; it should represent all of the UI controls the application will show, but without any localizable text or content. (Think of how the the built-in apps like iPod and Contacts behave.)
If you're doing it for a client and they demand it, you can always use the "But the app store might reject it for violating their terms!" argument.
Of course, this doesn't apply if you're not submitting to the Store or if you just don't care. :)
A technical add-on for the people posting above: make sure that any png compositing you're adding to the build process runs before pngcrush executes, so that you're not replacing an optimized image with a script-generated (and likely unoptimized) one. You may also run into weird issues if you try doing it after pngcrush runs (it not displaying), anyway.

Is there a way to convert epub format to images?

I need a tool to programmatically convert epub files to a series of images. The output should look like screenshots taken on a canonical device (for this application, an iPad). I haven't been able to find any tools that do something like this.
So what I'd really like (1) is a tool that does that. But assuming that I'm correct that no such tool exists, is there (2) a library (preferably a Perl module, but I'm not that picky) that will read and render ePub?
Obviously, rolling my own I could combine tools for unzipping, reading html, reading xml, putting everything in the right order, and rendering html within certain constraints. Though I'd rather not do that, and if that's the only option I'll have to go on to look for a tool that will do the last part of that or I'll have to create that too.
Any leads on (1), or failing that (2)?
Apologies if what I'm about to type is just crazy-talk on my part--in fact, I'm pretty sure it is--but perhaps something like this might work and I'm kind of interested in knowing how well it might work for you:
Use Frank (https://github.com/moredip/Frank) to control the iOS Simulator on a Mac. Program it to open up the EPUB docs you need.
All you need then is something to automate the taking of the screen shots. Obviously, these will look like the EPUBs are being rendered in an iPad (or an iPhone if you wish--the iOS Simulator does both, of course).
Automating the screenshots can probably be done with AppleScript, although the hard part might be getting it to talk to Frank. Worst case, you can tell Frank to pause for 5 seconds after it loads each page and tell AppleScript to take a screen shot every five seconds. That sucks, but if you're desperate, it will get it done. It's also possible Frank can somehow make the screenshots happen--I haven't used it enough to know.
Pandoc can convert from EPub to LaTeX (and therefore to PDF) or to any number of other formats. Conceptually this should be a type (1) solution.
depends on your definition of "look like" - do you want the user-chrome or just the epub rendering for a given screen size.
I would check out the various epub readers for your platform of choice, size the window to your preferred dimensions, and then just "print" the epub to a virtual printer that outputs to image files - on windoze I use imageprint.
You could easily make a "frame" from an iPad product shot and place your screenshots within that - only thing missing would be as I said the user chrome.

Are there any tutorials on coding a parser for SVG files to be used by box2D?

I am trying to create an iPhone game with fairly large levels. Hard coding the platforms and physics objects is very time consuming. I have seen some people have made their own parsers for svg files to use in box2D, and Riq is selling levelSVG but it is a little pricey for me at the moment, and I only need basic features. Is there a tutorial on how to code a parser available online?
Have you taken a look at SVGQuartzRenderer? It is designed to render SVG files in Quartz, so I imagine you might be able to pull out the SVG parsing code from this. It's opensource, MIT license.
I don't know about any tutorials but its fairly easy to do this using an XML parsing library. In my project I use MiniDOM to load an svg file and then I convert the elements into objects in the box2d word. The only thing that I had to do manually was the parsing of the path element.
I've written an extensive tutorial on how to parse SVG files using Apache Batik SVG library. Included with the tutorial are a set of classes and a function I wrote in Java which will generate a set of Vec2 points given the location of the SVG file. If you're using Objective C you could try to port the scripts or at least get an idea of the process involved. The scripts support multiple paths per SVG file, transformations, straight lines and quadratic splines. The first tutorial in the series can be found here.

Examples and/or 3RD Party Libraries to Optimize Display of PDFs on iPad

I have read numerous posts here (and experienced first hand) some of the limitations of using UIWebView to display PDF files on iPad/iPhone.
Are there any 3rd party libraries that handle PDF page rendering/caching/optimization? Don't need to handle adding annotations or markups to the PDF; just want to minimize delays in opening the document and moving between pages in PDFs.
Thanks.
Instead of using UIWebView use CoreGraphics. The best library I have seen for implementing PDF's with this is the Leaves library.
You will need to get familiar with the CGPDF calls and if you are not experienced with CoreGraphics it can be a bit tricky at first but the framework I suggested makes things pretty simple to get started and do basic things like displaying a local document or document on a server.

adding text to TIFF

I need to add text string to a TIFF image. I am planning to use libTIFF for editing the TIFF image. The plan is to convert text to image using freetype2 and then somehow render the text image on to TIFF. Is this the right approach?
Any pointers on how to convert text to image? I saw the sample code of ft2 - initialising the library, creating face and then setting character sizes. But not sure what to do next? any pointers appreaciated.
One way could be using ImageMagick. They have tools for image composition and text rendering. (and many more)
Although ImageMagick is primarily used from the command line (especially in web environments) several language interfaces are available, too. Java, C, C++, ...
ImgSource is a really nice library for C/C++ on Windows, and it can do this out of the box.
http://www.smalleranimals.com/isource.htm
It's not free, but it's pretty cheap ($59)
You don't tell us which language you need to use, should it be portable or for a given platform, etc.
Using a ready to use existing graphic library, like the (big!) ImageMagick or others like libGD or DevIL might be the easiest way, lot of them have binding for lot of languages.
if youre on windows and in c++ then it's pretty easy to use gdiplus for drawing fonts. you have access to any installed font and you can save the raster out as tiff or jpeg etc as well using the one api.
of course you could also use some combo of freetype and libtiff, but you'll have to build those libs for win32. not that its hard, just more fussing around you may not want to do.