Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi , I have a .png image file which contain one ip address . I need to get that ip address into a variable and validate it. How to do this using perl ?

Replies are listed 'Best First'.
Re: Extract data from .png file
by marto (Cardinal) on Aug 04, 2010 at 10:01 UTC

    If you mean that the image itself displays an IP address use the ocr Image::OCR::Tesseract module from CPAN.

    Update: Changed module.

      Yes the image contain ip address and i need to get that ip address into a variable using perl

        Then use the updated module I suggested. If you need help installing modules see Installing Modules from the tutorials section of the site.

      When i try to install that module its giving me the below error "# Failed test 'get_ocr()' # at t/02_Image_OCR_Tesseract.t line 72. . . . . Test Summary Report ------------------- t/02_Image_OCR_Tesseract.t (Wstat: 512 Tests: 22 Failed: 2) Failed tests: 14, 22 Non-zero exit status: 2 Files=3, Tests=26, 7 wallclock secs ( 0.03 usr 0.01 sys + 5.42 cusr 0.58 csys = 6.04 CPU) Result: FAIL Failed 1/3 test programs. 2/26 subtests failed. make: *** test_dynamic Error 255 LEOCHARRE/Image-OCR-Tesseract-1.24.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports LEOCHARRE/Image-OCR-Tesseract-1.24.tar.gz Running make install make test had returned bad status, won't install without force " How to over come this problem ?????

        Did you install the dependencies as mentioned in the README file?

Re: Extract data from .png file
by BrowserUk (Patriarch) on Aug 04, 2010 at 10:04 UTC

    Do you have an example? Perhaps you could paste it here